HTML Table Examples

, ,

This page shows some examples of using the “table” tag in HTML.

Table example 1

1,1 1,2 1,3
2,1 2,2 2,3

Here's the source code:

<table border="1">
<tr>
<td>1,1</td>
<td>1,2</td>
<td>1,3</td>
</tr>

<tr>
<td>2,1</td>
<td>2,2</td>
<td>2,3</td>
</tr>
</table>

Table Example With Column Span

1,1 1,2 and 1,3
2,1 2,2 2,3

Here's the source code:

<table border="1">
<tr>
<td>1,1</td>
<td colspan="2">1,2 and 1,3 </td>
</tr>

<tr>
<td>2,1</td>
<td>2,2</td>
<td>2,3</td>
</tr>
</table>

Table Example With Row Span

1,1 and 2,1 1,2 1,3
2,2 2,3

Here's the source code:

<table border="1">
<tr>
<td rowspan="2">1,1 and 2,1</td>
<td>1,2</td>
<td>1,3</td>
</tr>

<tr>
<td>2,2</td>
<td>2,3</td>
</tr>
</table>

caption & {thead, tbody, tfoot} & {colgroup, col}

See:

Reference

blog comments powered by Disqus