<html>
<head>
<title>HTML Tables</title>
</head>
<body>
<table border="1">
<tr>
<td>Row 1, Column 1</td>
<td>Row 1, Column 2</td>
</tr>
<tr>
<td>Row 2, Column 1</td>
<td>Row 2, Column 2</td>
</tr>
</table>
</body>
</html>
Row 1, Column 1 | Row 1, Column 2 |
Row 2, Column 1 | Row 2, Column 2 |
<html>
<head>
<title>Table Header</title>
</head>
<body>
<table border="1">
<tr>
<th>Roll Number</th>
<th>Marks</th>
</tr>
<tr>
<td>FTL_001</td>
<td>462</td>
</tr>
<tr>
<td>FTL_002</td>
<td>435</td>
</tr>
<tr>
<td>FTL_003</td>
<td>409</td>
</tr>
</table>
</body>
</html>
Roll Number | Marks |
---|---|
FTL_001 | 462 |
FTL_002 | 435 |
FTL_003 | 409 |
<html>
<head>
<title>Table Height & Width</title>
</head>
<body>
<table border="1" width="450" height="100">
<tr>
<td>Sample 1</td>
<td>Sample 2-1</td>
</tr>
<tr>
<td>Sample 1-1</td>
<td>Sample 2-2</td>
</tr>
</table>
</body>
</html>
Sample 1 | Sample 2-1 |
Sample 1-1 | Sample 2-2 |
<html>
<head>
<title>Table Header, Body, and Footer</title>
</head>
<body>
<table border="1" width="100%">
<thead>
<tr align="center">
<td colspan="4">Table Header</td>
</tr>
</thead>
<tfoot>
<tr align="center">
<td colspan="4">Table Footer</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Sample Text 1</td>
<td>Sample Text 2</td>
<td>Sample Text 3</td>
<td>Sample Text 4</td>
</tr>
</tbody>
</table>
</body>
</html>
Table Header | |||
Table Footer | |||
Sample Text 1 | Sample Text 2 | Sample Text 3 | Sample Text 4 |
<html>
<head>
<title>HTML Table Caption</title>
</head>
<body>
<table border="1" width="100%">
<caption>This is the table caption</caption>
<tr>
<td>Sample 1-1</td><td>Sample 1-2</td>
</tr>
<tr>
<td>Sample 2-1 </td><td>Sample 2-2</td>
</tr>
</table>
</body>
</html>
Sample 1-1 | Sample 1-2 |
Sample 2-1 | Sample 2-2 |
<html>
<head>
<title>HTML Table Cellpadding & Cellspacing</title>
</head>
<body>
<table border="1" cellpadding="5" cellspacing="5">
<tr>
<th>Roll No</th>
<th>Marks</th>
</tr>
<tr>
<td>FTL-001</td>
<td>462</td>
</tr>
<tr>
<td>FTL_002</td>
<td>435</td>
</tr>
<tr>
<td>FTL_003</td>
<td>409</td>
</tr>
</table>
</body>
</html>
Roll No | Marks |
---|---|
FTL-001 | 462 |
FTL_002 | 435 |
FTL_003 | 409 |
<html>
<head>
<title>HTML Table Colspan & Rowspan</title>
</head>
<body>
<table border="1">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td rowspan="2">Sample 1</td>
<td>Sample 1 - 2</td>
<td>Sample 1 - 3</td>
</tr>
<tr>
<td>Sample 2 - 2</td>
<td>Sample 2 - 3</td>
</tr>
<tr>
<td colspan="3">Sample 3 - 1</td>
</tr>
</table>
</body>
</html>​
Column 1 | Column 2 | Column 3 |
---|---|---|
Sample 1 | Sample 1 - 2 | Sample 1 - 3 |
Sample 2 - 2 | Sample 2 - 3 | |
Sample 3 - 1 |
<html>
<head>
<title>HTML Table Backgrounds</title>
</head>
<body>
<table border="1" bordercolor="yellow" background="images/table_bg.jpg">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td rowspan="2">Row 1 Cell 1</td>
<td>Row 1 Cell 2</td>
<td>Row 1 Cell 3</td>
</tr>
<tr>
<td>Row 2 Cell 2</td>
<td>Row 2 Cell 3</td>
</tr>
<tr>
<td colspan="3">Row 3 Cell 1</td>
</tr>
</table>
</body>
</html>
Column 1 | Column 2 | Column 3 |
---|---|---|
Row 1 Cell 1 | Row 1 Cell 2 | Row 1 Cell 3 |
Row 2 Cell 2 | Row 2 Cell 3 | |
Row 3 Cell 1 |
<html>
<head>
<title>HTML Nested Table</title>
</head>
<body>
<table border="1" width="100%">
<tr>
<td>
<table border="1" width="100%">
<tr>
<th>Roll No</th>
<th>Marks</th>
</tr>
<tr align="center">
<td>FTL_001</td>
<td>462</td>
</tr>
<tr align="center">
<td>FTL_002</td>
<td>435</td>
</tr>
<tr align="center">
<td>FTL_003</td>
<td>409</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
|