<table><tr><td>

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O
Type

The TABLE element defines a table, and the TR and TD elements are used to define rows and cells.


<table>
<tr>
<td>content of table</td>
</tr>
</table>

TABLE tag, TR tag, TD tag

The TABLE tag <table> - </table>
Defines a table.
The TR tag <tr> - </tr>
Defines a row in a table.
The TD tag <td> - </td>
Defines a cell in a table.

Example

A table of one row

<table border="3">
<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>
</table>

Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
A table of two rows

<table border="3">

<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>

<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>

</table>

Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3

If the border attribute is not specified, the border of the table is not displayed.


<table>

<tr>
<td>Row1 - Col1</td>
<td>Row1 - Col2</td>
<td>Row1 - Col3</td>
</tr>

<tr>
<td>Row2 - Col1</td>
<td>Row2 - Col2</td>
<td>Row2 - Col3</td>
</tr>

</table>

Output
Row1 - Col1 Row1 - Col2 Row1 - Col3
Row2 - Col1 Row2 - Col2 Row2 - Col3