Very useful print styles for long tables

For the second time I had to set print styles for a long table.  I'm adding the code here so next time it will be easier to find.

* { background: #fff; color: #000; } /* Save the color ink */ table { page-break-inside: auto; /* Allow page breaks when needed */ width: 100%; } th { color:black; border-left: none; border-right: none; border-top: none; border-bottom: 2px solid black; text-align: left; font-size: 12px; } thead { display:table-header-group; /* Repeat column headers on new pages */ } tbody { display:table-row-group; font-size: 10px; } td { border-bottom:1px solid #aaaaaa; border-left: none; border-right: none; border-top: none; } tr {page-break-inside: avoid; /* Avoid page breaks inside table rows*/}
Feedback
Please post your comments:
Name:
Email (optional): Your email address will not be posted.
URL (optional):
Comments: