Nested Tables:
Creating table with in another table is called Nested Table.
Example:
Here we are creating table with in another table.
The following example shows how to create nested tables
<html>
<head>
<title>Table with attribute</title>
</head>
<body>
<table align="center" width="400px" height="150px" border="1" cellpadding="0" cellspacing="0">
<caption>Student Details</caption>
<tr bgColor="gray"><th>Name</th><th>Age</th><th>College</th></tr>
<tr><td>Jadav</td><td>26</td><td>SMM college</td></tr>
<tr><td>Maharoop</td><td>26</td><td>SMM college</td></tr>
<tr><td>prasad</td><td>26</td>
<td>
<table width="313" height="76" cellpadding="5"
bgcolor="#CCCCCC" cellspacing="0" border="1">
<tr><td>First Year</td><td>Second Year</td></tr>
<tr><td>VMS College</td><td>GMS College</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
OUTPUT:
In above example we created nested table in 3rd row 3rd column.
Nested table contains two rows and two columns.
For Demo : Click Here
Creating table with in another table is called Nested Table.
Example:
Here we are creating table with in another table.
The following example shows how to create nested tables
<html>
<head>
<title>Table with attribute</title>
</head>
<body>
<table align="center" width="400px" height="150px" border="1" cellpadding="0" cellspacing="0">
<caption>Student Details</caption>
<tr bgColor="gray"><th>Name</th><th>Age</th><th>College</th></tr>
<tr><td>Jadav</td><td>26</td><td>SMM college</td></tr>
<tr><td>Maharoop</td><td>26</td><td>SMM college</td></tr>
<tr><td>prasad</td><td>26</td>
<td>
<table width="313" height="76" cellpadding="5"
bgcolor="#CCCCCC" cellspacing="0" border="1">
<tr><td>First Year</td><td>Second Year</td></tr>
<tr><td>VMS College</td><td>GMS College</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
OUTPUT:
In above example we created nested table in 3rd row 3rd column.
Nested table contains two rows and two columns.
For Demo : Click Here

0 comments:
Post a Comment