Using Tables
Tables can be used to display scientific data or to make comparisons between two sets of information.
Table
All tables must first begin with a table element, to set the structure. A typical table will start with something like this:
<html>
<head>
<title>HTML for Beginners - Basic HTML</title>
</head>
<body>
<table>
</table>
</body>
</html>Table Row
Just like tables in spreadsheets and databases, HTML tables consist of rows and cells. The cells will come in a second, but you have to specify where new rows begin:
<html>
<head>
<title>HTML for Beginners - Basic HTML</title>
</head>
<body>
<table>
<tr></tr>
</table>
</body>
</html>Table Data
The data elements contain the actual cell contents:
<html>
<head>
<title>HTML for Beginners - Basic HTML</title>
</head>
<body>
<table>
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>
</body>
</html>
And this will produce
| Row 1, Column 1 | Row 1, Column 2 |
| Row 2, Column 1 | Row 2, Column 2 |