Topic summary

Table cell

Table cell

Extracted from the Wikipedia article Table (format).

HTML

Table cells are a key component in HTML and webpage building. It is part of the <table> component. A programmer may specify dimensions for a table cell, and use them to hold sections of webpages. A table cell in HTML is a non-empty element and is supposed to always be closed. There are two different kinds of table cell in HTML, namely: normal table cell and header cell. <td> denotes a table cell, the name implying 'data', while <th> denotes a table 'header'. The two can be used interchangeably, but it is recommended that header cell be only used for the top and side headers of a table. Furthermore, a table cell must be nested within a <table> tag and a <tr> (table row) tag. If there are more table cell tags in any given row than in any other, the particular <tr> must be given a colspan attribute declaring how many columns of cells wide it should be. By using the rowspan and colspan attributes, developers can combine multiple rows or columns, allowing them to design more complex and visually structured tables.