Repeating HTML table headings when printing

Written on March 18, 2005
If you are creating HTML pages with tabular data, then you are probably using tables to display that data. When you print out those tables, wouldn't it be nice if the table heading rows (if you have any) are repeated at the top of each page? If you add these styles to your HTML, and make use of the THEAD and TBODY tags to identify the header rows and body rows of your table, then in a modern browser it will do just that! <!-- print style sheet --> <style type="text/css" media="print"> thead {display: table-header-group; } tfoot {display: table-footer-group; } thead th, thead td {position: static; } </style>