Tables in HTML: Prepared by Harish Patnaik
Tables in HTML: Prepared by Harish Patnaik
1. Simple table
2. Table dimension
3. Coloring table
4. Table cell span
Table
Sl no. Roll no Marks
<html> 1 1830110 84
<body> 2 1830175 78
<table border=”2”>
<tr>
<th> Sl no.</th>
<th> Roll no</th>
<th>Marks</th>
</tr>
<tr>
<td> 1</td>
<td>1830110</td>
<td>84</td>
</tr>
</table>
</body>
</html>
Table
Table dimensions -
<body>
<table width=”500” height=”400”>
<tr>
<th width=”20%”> Sl no.</th>
<th width=”40%”> Roll no</th>
<th width=”40%”>Marks</th>
<tr>
</table>
</body>
</html>
Table
Coloring Table -
<body>
<table bgcolor= “ ” background=”abc.jpg”>
<tr bgcolor=”blue”>
<th bgcolor= “pink”width=”20%”> Sl no.</th>
<th bgcolor= “yellow”width=”40%> Roll no</th>
<th bgcolor= “cyan”width=”40%>Marks</th>
<tr>
</table>
</body>
</html>
Table
Table cell span - Marks
Roll no
<body> WT DBMS OS
<table >
<tr> 1830175 83 68 74
<th rowspan=2> Roll no</th>
<th colspan=3> Marks</th>
</tr>
<tr>
<th> WT</th>
<th> DBMS</th>
<th> OS</th>
</tr>
<tr>
<td>1830175</td>
<td>83</td>
<td>68</td>
<td>74</td>
</tr>
</table>
</body>
Table
Table cellpadding and cellspacing -
§ Space between two consceutive cells - cellspacing
§ Space between cell border and cell content - cellpadding
abcd
cellpadding cellspacing