Table Tags

Tags Purpose
<table> To create the table outline
<tr> To create rows in the table
<td> Add data to the table precisly to the row, will be placed in columns next to each other
<th> Creates the heading and seperates it from rest of the data by making it aittle bold
<thead> Seperates the head of the table from rest of the table
<tbody> Sepeartes the body of the table from rest of the table, normally containes the data that belong to the column heading topics column by coumn
<tfooter> Seperates the footer from the rest of the table.

Table - Parts:

Borders in a table :

Border-Style:



Border Rowspan & Colspan:




cell 1 Cell2 cell 3
cell 4 cell5 cell 6


Above table shows how rowspan looks like
Code:


<td rowspan="2"> cell1 </td>



Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6


Above table shows how colspan looks like


Code:


<td colspan="3"> cell1 </td>



Cell 1 Cell 2
Cell 3 Cell 4


Above table shows how to add color to the Cell

Code in html(CSS inline): <td bgcolor="blue"> cell1 </td>

Code in CSS: selector{color:blue}