You are here: Re: printing a long HTML table « HTML « IT news, forums, messages
Re: printing a long HTML table

Posted by Dima Gofman on 09/14/05 23:38

> Larry wrote:
>
>> I have a CGI program that generates a fairly long HTML table in
>> response to a query. How do I make it so that the user can print the
>> table from their browser and have the column headings show up on the
>> top of each page? I know about the "page-break-after" style tag, but I
>> have no way to know when to output it. Another option I've considered
>> is something like Crystal Reports, but that's expensive, complex, and
>> way more than what I need.
>>

Simple! In FireFox it's enough to simply use <thead> and <th> tags and
to get the same effect in IE all you need is a bit of CSS. Like so:

<html><head><title></title>
<style type='text/css'>
thead{display:table-header-group}
</style>
</head><body>
<table>
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
<th>col4</th>
<th>col5</th>
</tr>
</thead>
<tbody>
<tr>
<td>x1</td>
<td>x2</td>
<td>x3</td>
<td>x4</td>
<td>x5</td>
</tr>
..........alot of rows...........
</tbody>
</table></body></html>


-
Dima Gofman

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация