0% found this document useful (0 votes)
64 views7 pages

HTML Tables with Various Formats

The document contains several HTML code examples demonstrating the use of different table formatting options in HTML such as aligning, adding borders, captions, rowspans, colspans, widths and heights. The tables contain sample header and data cells to showcase these formatting features.

Uploaded by

Rahul Mangal
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)
64 views7 pages

HTML Tables with Various Formats

The document contains several HTML code examples demonstrating the use of different table formatting options in HTML such as aligning, adding borders, captions, rowspans, colspans, widths and heights. The tables contain sample header and data cells to showcase these formatting features.

Uploaded by

Rahul Mangal
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

<!

DOCTYPE html>
<html>
<body>
<table align="center">
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 11</td>
<td>Data 12</td>
</tr>
<tr>
<td>Data 21</td>
<td>Data 22</td>
</tr>
<tr>
<td>Data 31</td>
<td>Data 32</td>
</tr>
</table>
</body>
</html>

<!DOCTYPE html>
<html>
<body>
<table border="1">
<caption align="right">Table
Caption</caption>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td align="center">Data 11</td>
<td>Data 22</td>
</tr>
<tr>
<td align="right">Data 21</td>
<td>Data 22</td>
</tr>
<tr>
<td>Data 31</td>
<td>Data 32</td>
</tr>
</table>
<table border="5">
<caption align="right">Table
Caption</caption>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td align="center">Data 11</td>
<td>Data 22</td>
</tr>
<tr>
<td align="right">Data 21</td>
<td>Data 22</td>
</tr>
<tr>
<td>Data 31</td>
<td>Data 32</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<table border="1" align="center">
<tr>
<td><b>Header 1</b></td>
<td>Data 11</td>
<td>Data 21</td>
<td>Data 31</td>
</tr>
<tr>
<th>Header 2</th>
<td>Data 12</td>
<td>Data 22</td>
<td>Data 32</td>
</tr>
</table>
<br>
</body>
</html>

<!DOCTYPE html>
<html>
<body>
<table border="1" align="center">
<tr>
<th rowspan="2">Header</th>
<td >Data 11</td>
<td>Data 21</td>
<td>Data 31</td>
</tr>
<tr>
<td>Data 12</td>
<td>Data 22</td>
<td>Data 32</td>
</tr>
</table>
<br>

<table border="1" >


<tr>
<th colspan="2">Header</th>
</tr>
<tr>
<td width="250" >Data 11</td>
<td>Data 22</td>
</tr>
<tr height="100">
<td>Data 21</td>
<td>Data 22</td>
</tr>
<tr>
<td>Data 31</td>
<td>Data 32</td>
</tr>
</table>
</body>
</html>

<!DOCTYPE html>
<html>
<body>
<table border="1" align="center"
bordercolor="red">
<tr>
<th>Header 1</th>
<td><img src="[Link]" width="200"
height="100"></td>
<td>Data 21</td>
<td>Data 31</td>
</tr>
<tr>
<td><b>Header 2</b></td>
<td>Data 12</td>
<td>Data 22</td>
<td>Data 32</td>
</tr>
</table>
</body>
</html>

You might also like