Table Tutorial
This is how to create a basic html table, like this:
1,1 | 1,2 | 1,3 |
---|---|---|
2,1 | 2,2 | 2,3 |
3,1 | 3,2 | 3,3 |
Some styling will be used to give each cell a border, which helps illustrate this better:
<style>
table, th, td {
border:1px solid black;
}
</style>
The code for the table above looks like this:
<table style="width:100%;">
<tr>
<th>1,1</th>
<th>1,2</th>
<th>1,3</th>
</tr>
<tr>
<td>1,1</td>
<td>1,2</td>
<td>1,3</td>
</tr>
<tr>
<td>1,1</td>
<td>1,2</td>
<td>1,3</td>
</tr>
</table>
"<tr>" and "</tr>" define each row. "<td>" and "</td>" define each cell. "<th>" and "</th>" can replace "td" and are used to bold and center text in a cell, generally for headers.
' style="width" ' can be used to dictate how wide the table is, in the case of the example code it takes up 100% of the available space, but this can be altered.