HTML4 HTML5
Creates a table[cite: 3].
Both opening and closing tags are mandatory[cite: 3].
The browser will interpret this code as follows:
| Last Name | First Name |
|---|---|
| Kowalski | Jan |
| Nowak | Dominika |
The table consists of 2 columns and 3 rows[cite: 3]. Each row is contained between <tr> and </tr> tags[cite: 3]. Inside rows, <td> tags define individual table cells[cite: 3].
First row text marked with <th> as a header row is bolded and centered by default, with column widths adapted to content[cite: 3].
Table appearance can be modified using attributes[cite: 3]:
width="..." - HTML5 does not support this attribute, specifies table width[cite: 3]:
align="..." - HTML5 does not support this attribute, specifies default text alignment in table[cite: 3]:
bgcolor="..." - HTML5 does not support this attribute, specifies table background color[cite: 3]:
border="value" - HTML5 does not support this attribute, 0 defines no border, 1 - bordered table[cite: 3].
cellpadding="value" - HTML5 does not support this attribute, specifies cell content padding in pixels[cite: 3].
cellspacing="value" - HTML5 does not support this attribute, specifies spacing between cells in pixels[cite: 3].
frame="parameter" - HTML5 does not support this attribute, specifies table border rendering mode[cite: 3]:
rules="parameter" - HTML5 does not support this attribute, specifies internal cell rules visibility[cite: 3]: