what's the big difference between <td> and <th>? When to use <td> effectively and when to use <th> effectively?
what's the big difference between <td> and <th>? When to use <td> effectively and when to use <th> effectively?
<th> defines a header cell, <td> a normal cell:
This code will give you an example:
I rarely use <th>HTML Code:<table border = "1"> <tr> <th>Tag</th> <th>Description</th> </tr> <tr> <td>td</td> <td>Specifies a table header</td> </tr> </table>
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.
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.
<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.
Code:<tr> <th scope="col">Artist</th> <th scope="col">Title</th> <th scope="col">Price</th> <th scope="col">Quantity</th> <th scope="col">Sales</th> </tr> <tr> <td>Bob Dylan</td> <td>Empire Burlesque</td> <td>$25.00</td> <td>6</td> <td>$150.00</td> </tr>
<th> also provides print functionality.
Bookmarks