table in table html code example
Example 1: table html
<table>
<thead>
<tr>
<th>header1</th>
<th>header2</th>
<th>header3</th>
</tr>
</thead>
<tbody>
<tr>
<td>text1.1</td>
<td>text1.2</td>
<td>text1.3</td>
</tr>
<tr>
<td>text2.1</td>
<td>text2.2</td>
<td>text2.3</td>
</tr>
<tr>
<td>text3.1</td>
<td>text3.2</td>
<td>text3.3</td>
</tr>
<tr>
</tr>
</tbody>
</table>
Example 2: html create a table
<html>
<head>
<title>Working with HTML Tables</title>
</head>
<body>
<table> <!-- create an table object -->
<tr> <!-- "tr" represents a row -->
<th>Name</th> <!-- use "th" to indicate header row -->
<th>Date of Birth</th>
<th>Weight</th>
</tr>
<tr> <!-- once again use tr for another row -->
<td>Mary</td> <!-- use "td" henceforth for normal rows -->
<td>12/13/1994</td>
<td>130</td>
</tr>
</table>
</body>
</html>
Example 3: table css
tr , th , td {
border: 1px solid black;
padding: 5%;
text-align: center;
}
Example 4: tables in html
<table>
<thead> <!--Table Head-->
<th>Year</th> <!--Table Heading-->
<th>Work</th> <!--Table Heading-->
</thead>
<tbody> <!--Table Body-->
<tr> <!--Table Row-->
<td>2019-2020</td> <!--Table Data for row1-->
<td>self-taught Python Developer</td> <!--Table Data for row1-->
</tr>
<tr>
<td>2020-2021</td>
<td>Learning Advanced Python</td>
</tr>
</tbody>
<tfooter>
</tfooter>
</table>
Example 5: plain table in html
<table>
<tr>
<th>Name</th>
<th>Favorite Color</th>
</tr>
<tr>
<td>Bob</td>
<td>Yellow</td>
</tr>
<tr>
<td>Michelle</td>
<td>Purple</td>
</tr>
</table>
Example 6: table inside another table in html
<table width="100%">
<tr>
<td>Name 1</td>
<td>Name 2</td>
<td colspan="2">Name 3</td>
<td>Name 4</td>
</tr>
<tr>
<td rowspan="3">ITEM 1</td>
<td rowspan="3">ITEM 2</td>
<td>name1</td>
<td>price1</td>
<td rowspan="3">ITEM 4</td>
</tr>
<tr>
<td>name2</td>
<td>price2</td>
</tr>
<tr>
<td>name3</td>
<td>price3/td>
</tr>
</table>