0% found this document useful (0 votes)
60 views9 pages

Tables in HTML: Prepared by Harish Patnaik

This document discusses HTML tables. It provides examples of creating a basic table with rows and columns, setting table dimensions using width and height attributes, coloring different parts of the table using bgcolor, and using cell spanning with rowspan and colspan. It also covers cellpadding and cellspacing for adding spacing between cells and between cell borders and content. Images can be added to tables by placing them in table cells.

Uploaded by

435Abinash Panda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views9 pages

Tables in HTML: Prepared by Harish Patnaik

This document discusses HTML tables. It provides examples of creating a basic table with rows and columns, setting table dimensions using width and height attributes, coloring different parts of the table using bgcolor, and using cell spanning with rowspan and colspan. It also covers cellpadding and cellspacing for adding spacing between cells and between cell borders and content. Images can be added to tables by placing them in table cells.

Uploaded by

435Abinash Panda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Tables in HTML

Prepared by Harish Patnaik

School of Computer Engineering, KIIT Deemed to be University


Content

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

<table cellspacing=”4” cellpadding=”2”>


</table>
Image
<img src= “mypic.gif” align=”right” />
<img width= “ “ height= “ “ border= 2/>
<body>
<table width=”500” height=”400”>
<tr>
<td><img src=”abc.gif” /></td>
<td>Prime Minister of India </td>
</tr>
</table>
</body>
Thank you

You might also like