简体   繁体   中英

Format a print request on a webpage?

I have created a website to act as a work order creation/fill out system for employees.

Currently work orders are viewed just by looking at a page with a table and various filters so they can order their work orders. However, if they want to print the page, it's a pretty big mess as it gets stretched out across 3 pages, prints the page header, logos, filter buttons, etc.

Is there any way I can make a 'Print' button, or somehow format the way the page looks when it is printed so it can cut out all the extra stuff and just try to keep the table on a single page?

You should use @media print css rule. For example:

@media print {
    #logo {
        display: none;
    }
}

You should consider adding a print css stylesheet to show/hide certain areas of the table or to rescale the container of the table to print sizes. Here is more information: http://www.onextrapixel.com/2009/05/05/how-to-create-a-simple-print-css-for-your-site/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM