TBODY tag in a XHTML table

25 June 2004   2 comments   Web development

Powered by Fusion×

For all HTML language lawyers out there... I've got a page that is defined as XHTML 1.0 Transitional and in it I use a table that has many <tbody> tags, in these I have a class definition like this:

<table>
  <tr>
    <th>No</th><th>Name</th>
  </tr>
  <tbody class="foo">
    <tr>
      <td>1.</td><td>One</td>       
    </tr>
  </tbody>
</table>

That was not valid XHTML according to the W3C Validator and it took me some time to figure out why. Now I've got it! One has to use the thead tag too if you want to use the tbody tag. Here's an example:

<table>
  <thead>
    <tr>
      <th>No</th><th>Name</th>
    </tr>
  </thead>
  <tbody class="foo">
    <tr>
      <td>1.</td><td>One</td>       
    </tr>
  </tbody>
</table>

Worth remembering.

Comments

abhinav
hi,

your site in very simple and not attractive....design purpose

so i hope you re-design.
abhinav
Thanks for the article. It was useful.

That's a very unproductive comment abhinav.

Regards,
Daniel
Thank you for posting a comment

Your email will never ever be published


Related posts

Previous:
Dan's just been to Sweden 23 June 2004
Next:
Holiday for a week 26 June 2004
Related by keywords:
To readline() or readlines() 12 March 2004
bool is instance of int in Python 05 December 2008
Reciprocal lesson about gender perspectives 02 September 2011
Nginx vs. Squid 17 March 2009
IssueTrackerProduct now officially abandoned 30 March 2012
How and why to use django-mongokit (aka. Django to MongoDB) 08 March 2010
On the command line no one can hear you screen. Or can they? 03 May 2012
Nasty surprise of Django cache 09 December 2008
Random ID generator for Zope 02 September 2005
Google Calendar, iCalendar Validator but not bloody Apple iCal 09 April 2009
In Django, how much faster is it to aggregate? 27 October 2010
tempfile in Python standard library 07 February 2006