HTML Table Attribute in html
- Get link
- X
- Other Apps
Table Tag Attributes
1) Rowspan Tag
The <tr> tag in HTML stands for "table row"
and is used to define a row in a table. It is placed inside a <table>
element and typically contains one or more <td> (table data) or <th>
(table header) elements. Each <tr> represents a single row of data or
headers in the table. Rows can be styled using CSS,
and can also work with rowspan and colspan attributes inside cells to span
across row or columns for better layout control.
Example
program
<html>
<body>
<h1>Example of TD Rowspan attribute</h1> <table border="1">
<th>Student</th>
<th>Fees Amount</th>
<th>Course</th>
</tr>
<tr>
<td>Manish</td>
<td>700</td>
<td rowspan="2">Java</td>
</tr> <tr>
<td>Puneet</td> <td>800</td>
</tr>
</table>
</body>
</html>
Rowspan Tag output
2] HTML <td> Colspan Attribute.
Question :-
Information :-
The colspan attribute HTML specifies the number of columns and cell should span. colspan allows to the single table cell span the width of more than one cell ,column. It's provides the same functionality as merge cell in spreadsheet program like Excel.
Example
<h1>Example of TD colspan attribute</h1> <table border="1">
<tr> <th colspan="2">Student Fees detail</th></tr>
<tr>
<th>Student</th>
<th>Fees Amount</th>
</tr>
<tr>
<td>Manish</td>
<td>1000</td>
</tr>
<tr>
<td>Puneet</td>
<td>2000</td>
</tr>
<tr> <td colspan="2">Total: 3000</td>
</tr>
</table>
Colspan Tag output
2) Example
Question :-
1] How to align text in top HTML?
2] How to align text in center HTML?
3] How to align text in Bottom HTML?
Alignment OUTPUT
Related Post
html table program
css border bottom property
html tag Attributes
html Tag attributes
meta attribute html
- Get link
- X
- Other Apps





Comments
Post a Comment