HTML Tables
HTML tables provide a way for web developers to organise data systematically by arranging it in rows and columns.
Define an HTML Table
In HTML, a table is formed by using table cells placed within rows and columns.
Table Cells
In HTML, each table cell is represented by the
<td>
and a </td>
tag.
The td
stands for table data. Anything enclosed between the <td>
and </td>
tags constitutes the content of the respective table cell.
Note: A table cell can hold a diverse range of HTML elements, such as text, images, lists, links, other tables, and more etc.
Table Rows
In HTML, every table row is delineated by the
<tr>
and ends with a </tr>
tags. Thetr
stands for table row.
Table Headers
Occasionally, you may need specific cells to serve as table header cells. In such instances, utilize the
<th>
tag instead of the <td>
tag:
th
stands for table header.
Typically, the text inside HTML tables can include headers for each column or row, or for multiple columns/rows. To make the first column of a table act as headers, designate the initial cell in each row as a HTML tables can contain cells that cover more than one row and/or column. To have a cell cover more than one column, apply the Note: The To have a cell cover more than one row in a table, utilize the Note: The elements is both bold and centered. However, you have the option to modify this appearance using CSS.
HTML Table Headers
EMIL
TOBIAS
LINUS
8:00
9:00
10:00
11:00
12:00
13:00
MON
TUE
WED
THU
FRI
8:00
9:00
10:00
11:00
12:00
DECEMBER
Vertical Table Headers
element.
HTML Table Colspan & Rowspan
NAME
APRIL
2022
FIESTA
HTML Table - Colspan
colspan
attribute in your HTML code.colspan
attribute's value tells how many columns it should cover.
HTML Table - Rowspan
rowspan
attribute.rowspan
attribute's value shows how many rows it should cover.