Tuesday, January 8, 2019

How to Create Tables in Html

Tables are powerful tools to show and relate a specific type of information.

Basic Table Tags
<table></table> For the netire table
<tr></tr> For table row
<td></td> For table cell
<th></th> For table cell and column heading



To create  a one row table, type the following table structure in HTML

<table>
<tr>
<td>Cell(2)</td>
<td>Cell(2)</td>
<td>Cell(2)</td>
</tr>
</table>


To create multiple rows in a table with a border line:

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


To create tables with heading

<table border="1">
<tr>
<th> Heading 1</th>
<th> Heading 2</th>
<th> Heading 3</th>
</tr>
<tr>
<td>Row 2 Cell 1</td>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
</tr>
<tr>
<td>Row 3 Cell 1</td>
<td>Row 3 Cell 2</td>
<td>Row 3 Cell 3</td>
</tr>
</table>