View Full Version : What's the difference between <td> and <th> tag?
06-16-2009, 12:41 PM
what's the big difference between <td> and <th>? When to use <td> effectively and when to use <th> effectively?
06-16-2009, 01:07 PM
<th> defines a header cell, <td> a normal cell:
This code will give you an example:
<table border = "1">
<td>Specifies a table header</td>
I rarely use <th>
the only use I have for <th> is formatting
06-16-2009, 08:35 PM
so, you can use either <td> or <th> interchangeably? There is no advantage nor disadvantage in using either the two?
depends on how you want to comfrom to standards and how clean you want your document to be in source view.
'i'd personaly only use <th> for its propper function as a table header.
06-16-2009, 09:57 PM
It also depends on whether or not you are making a distinction between the two in your stylesheet.
The only real inherent visual difference, as you saw in the code above, is that the <th> tag is naturally bold.
06-16-2009, 11:36 PM
06-28-2009, 02:10 PM
<th> is used in place of <td> to define a table header. This is used for accessibility purposes for disabled or impaired users. Not everyone can see a table (which makes accessibility for the blind difficult to interpret) so headers are encouraged by W3C accessibility guidelines to help identify and navigate a data table; with a screen reader like JAWS for example.
<td> should only be used for data, and <th> for the values attached to that data.
<th> also provides print functionality.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.