SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    tfoot printing issues

    I like making my HTML as semantic as possible. For this reason, if I have a table that logically needs a header and a footer, I use <thead /> and <tfoot /> respectively, which just seems to make a lot of sense:

    Code:
    <table>
    	<thead>
    		<tr>
    			<th>First Name</th>
    			<th>Last Name</th>
    		</tr>
    	</thead>
    	<tfoot>
    			<tr>
    				<td colspan="2">Thanks for checking out this great table. Blah Blah, yada yada....</td>
    			</tr>
    	</tfoot>
    	<tbody>
    		<tr>
    			<td>Fred</td>
    			<td>Flintstone</td>
    		</tr>
    		<tr>
    			<td>Barney</td>
    			<td>Rubble</td>
    		</tr>
    	</tbody>
    </table>
    However, when you print a table that results in multiple printed pages, the contents of <thead /> and <tfoot /> are repeated once on each page. I realize these tags were designed to do this. However, I'm wondering if there is some way (via CSS or otherwise) to specifically prevent the <tfoot /> from appearing on every printed page, and have it only print on the last one.

    I'm guessing the answer is no, but maybe there is something simple I'm missing.

    My alternative is to change the <tfoot /> to another <tbody /> and move it to the end of the table, but that just seems like a poor solution from a semantic HTML standpoint.

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    That's just the way tfoot and thead work. They will apper on every page.

    You will have to go with your alternative
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    SitePoint Member
    Join Date
    Feb 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rats. OK, I'll go that route. Thanks for the reply.

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Sorry buddy . And you're welcome.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •