Good rules for setting up print css? [closed]

Here are some general print styles to use to get better print outs:

/* Print styles */
@media print 
{
    tr, td, th {page-break-inside:avoid}
    thead {display:table-header-group}
    .NoPrint {visibility:hidden; display:none}
    a {color:#000000}
}

The top one prevents page breaks inside of a table row

The thead style makes any rows in the thead tag repeat for each page that the table spans across.

NoPrint is a class I use to show something on the screen, but not in print.

And, I like to turn off link colors.

Leave a Comment