![]() |
|
Working with HTML Tables, Free online HTML Tutorial, Learn HTML online for free... |
| Lessons | HTML Tables |
|
||||||||||||||||
|
The creation of a table in HTML is very simple and easy. A table in HTML begins with <table> and ends with </table>. Between these tags <tr> and </tr> is used to specify rows. <td> and </td> is used to specify a cell. <table border="1">
<tr>
<td>Name</td>
<td>Age</td>
</tr>
<tr>
<td>Mr. A</td>
<td>10 Years</td>
</tr>
<tr>
<td>Mr. B</td>
<td>20 Years</td>
</tr>
<tr>
<td>Mr. Z</td>
<td>60 Years</td>
</tr>
</table>
This HTML will be displayed as:
Note that the border attribute above specifies the thickness of the horizontal and verticles lines across the above table. We can specify that the first row of the table is headings by using <th> and </th> tags. <table border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Mr. A</td>
<td>10 Years</td>
</tr>
<tr>
<td>Mr. B</td>
<td>20 Years</td>
</tr>
<tr>
<td>Mr. Z</td>
<td>60 Years</td>
</tr>
</table>
This HTML will be displayed as:
In the next lesson we will be exploring html tables in some detail.
Next >>> Lesson No. 17: Advanced HTML Tables
|