Table Header Creation:
<head>
<title>Table with attribute</title>
</head>
<body>
<table align="center" width="300px" border="1" cellpadding="10">
<caption>Student Details</caption>
<tr bgColor="gray"><th>Name</th><th>Age</th><th>College</th></tr>
<tr><td>Manohar</td><td>26</td><td>smm</td></tr>
<tr><td>Manohar</td><td>26</td><td>smm</td></tr>
<tr><td>Manohar</td><td>26</td><td>smm</td></tr>
</table>
</body>
</html>
OUTPUT:
- Table header created with <th> tag.
- Here <th> means table header.
- Table Header differentiate from table data.
- By default header data aligned to center.
<table>
<tr>
<th>Name</th>
<th>Age</th>
<th>Course</th>
</tr>
</table>
Here first row mentioned as header section.
Example:
<html><head>
<title>Table with attribute</title>
</head>
<body>
<table align="center" width="300px" border="1" cellpadding="10">
<caption>Student Details</caption>
<tr bgColor="gray"><th>Name</th><th>Age</th><th>College</th></tr>
<tr><td>Manohar</td><td>26</td><td>smm</td></tr>
<tr><td>Manohar</td><td>26</td><td>smm</td></tr>
<tr><td>Manohar</td><td>26</td><td>smm</td></tr>
</table>
</body>
</html>
OUTPUT:

0 comments:
Post a Comment