Source


<html> <head> <title>Examples on Tables</title> </head> <body> <h1>Simple Table</h1> <table border="1" cellpadding="10"> <thead> <caption>Names and Places</caption> <tr> <th>Name</th> <th>Place</th> </tr> </thead> <tbody> <tr> <td>Teja</td> <td>Bhimavaram</td> </tr> <tr> <td>Rajesh</td> <td>Eluru</td> </tr> <tr> <td>Sudhakar</td> <td>Vijayawada</td> </tr> <tr> <td>Uday</td> <td>Gudivada</td> </tr> <tr> <td>Revanth</td> <td>Bhimavaram</td> </tr> </tbody> </table> <h1>Uneven Table</h1> <table border="1" cellpadding="10"> <thead> <tr> <th>Name</th> <th>Place</th> </tr> </thead> <tbody> <tr> <td>Teja</td> <td>Bhimavaram</td> </tr> <tr> <td>Rajesh</td> <td>Eluru</td> </tr> <tr> <td>Sudhakar</td> <td>Vijayawada</td> </tr> <tr> <td>Uday</td> <td>Gudivada</td> </tr> <tr> <td>Revanth</td> <td>Bhimavaram</td> </tr> </tbody> <tfoot> <tr> <td colspan="2" align="center">Names and Places</td> </tr> </tfoot> </table> <h1>Nested Tables</h1> <table border="1" cellpadding="10"> <tr> <td colspan="2">Outer table</td> </tr> <tr> <td> <table border="1"> <tr> <td>cell 1</td> <td>cell 2</td> </tr> <tr> <td>cell 3</td> <td>cell 4</td> </tr> </table> </td> <td> <table> <tr> <td>Inner table 2</td> </tr> </table> </td> </tr> </table> </body> </html>

Output


Simple Table

Names and Places
Name Place
Teja Bhimavaram
Rajesh Eluru
Sudhakar Vijayawada
Uday Gudivada
Revanth Bhimavaram

Uneven Table

Name Place
Teja Bhimavaram
Rajesh Eluru
Sudhakar Vijayawada
Uday Gudivada
Revanth Bhimavaram
Names and Places

Nested Tables

Outer table
cell 1 cell 2
cell 3 cell 4
Inner table 2