Friday, 18 March 2005

Repeating HTML table headings when printing

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>

1 comment:

Kartik Rangholiya said...

it is not working in chrome browser, is that any other way to do this. ..?