...my digital hub on the world wide web.

+ my writings and my work.

Printing Table Header & Footer with CSS

Published on September 29, 2004 in Design

Most of our Websydian pages are tables of data that extend over many pages when printed. One of the most important things to the user is always that the necessary headers and footers show up in the correct place. While it has always been easy to do this with Mozilla based browsers I recently ran across a way to do this in IE 6.
As long as the THEADs and TFOOTs are in their proper place Mozilla will print the table header and footer on each page. With IE, it is not that simple, IE requires the CSS properties display:table-header-group and display:table-footer-group to be used explicitly. Below is the sample CSS to define in your print stylesheet:

/*Needed for IE6. Must be stated explicitly to force the thead and tfoot to print on every page*/
thead { display: table-header-group;}
tfoot {display: table-footer-group;}

3 Trackbacks/Pingbacks

  1. Trackback: engagement photography on January 18, 2012
  2. Trackback: Cheap Materials on January 21, 2012
  3. Trackback: scripts | shop scripts | web scripts | website tools | tutorials | design | themes | php | html | html5 | clone on May 22, 2012

7 Comments

  1. Dan, November 9, 2004:

    I have tried the above style commands in a inline style sheet

    with the media specified as “media=”"print”" and cannot get this to work properly. Does this need to be in an external style sheet or am I possibly doing something else wrong? I also have a media=screen style specified for display.

  2. Jacek, February 27, 2008:

    It won’t work without javascript, I’ve found way how to repeat table header on each page and it works for me (http://www.codeproject.com/KB/grid/HeaderOnEachPage.aspx) but I don’t know how to change it to work also for tfoot.

  3. Raj, March 20, 2008:

    Works like a charm. Thanks for the tip. My clients are going to be very happy. I’m using it in an external (linked) css file without specifying media property. I use the same css for screen and print in this case.

  4. cream treatment for warts genital, February 16, 2013:

    I’m amazed, I have to admit. Rarely do I come across a blog that’s both equally educative and engaging, аnd let me tell you, you’ve hit the nail on the head. The issue is something too few people are speaking intelligently about. I am very happy I found this in my search for something concerning this.

  5. wood shed plans kits, February 23, 2013:

    It’s in fact very complex in this active life to listen news on Television, so I only use world wide web for that reason, and obtain the most up-to-date information.

  6. nanaherbal, April 24, 2013:

    Wonderful work! This is the type of info that are supposed to be shared across the net. Shame on Google for no longer positioning this put up higher! Come on over and talk over with my website . Thanks =)

  7. Scars are natural consequences of any incision or
    surgery. url + ‘” class=”adline1_title_link” target=”_blank”>’
    +. Because of controversy in the early 1990′s there was a widespread fear about the possibility of silicone breast implants causing autoimmune diseases in women.

Leave a comment

Your email is never published nor shared.




You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Who Am I?

Leslie Franke Profile

Leslie Franke:[les-lee fran-key]; 1. Husband and proud dogowner; 2. Seventh-day Adventist; 3. Web Designer; 4. Atlanta Braves Fan; 5. Northeast Ohio Native; 6. Bottle Caps Lover; 7. Certified 'Freakonomic';