HTML TUTORIALS-
HTML Table Colspan & Rowspan Tag –
Introduction-
HTML Table Colspan & Rowspan Tag -
🔷 What is colspan? -
- colspan allows a cell to span across multiple columns:-
🔷 What is rowspan? -
- rowspan allows a cell to span across multiple rows:-
✅ 2- Examples of HTML tables using colspan and rowspan each, with explanations so you can see how they work.and Follow Steps-
-)✅ Examples with colspan-👇
<table border="1">
<tr>
<th colspan="2">Name & Contact</th>
</tr>
<tr>
<td>Pramod Behera</td>
<td>123-456-7890</td>
</tr>
</table>
Name & Contact | |
---|---|
Pramod Behera | 123-456-7890 |
<table border="1">
<tr>
<th colspan="3">Employee Details</th>
</tr>
<tr>
<td>ID</td>
<td>Name</td>
<td>Department</td>
</tr>
</table>
Employee Details | ||
---|---|---|
ID | Name | Department |
<table border="1">
<tr>
<td rowspan="2">Math</td>
<td>Pramod</td>
</tr>
<tr>
<td>Pooja</td>
</tr>
</table>
Math | Pramod |
Pooja |
<table border="1">
<tr>
<td rowspan="3">Project A</td>
<td>Phase 1</td>
</tr>
<tr>
<td>Phase 2</td>
</tr>
<tr>
<td>Phase 3</td>
</tr>
</table>
Project A | Phase 1 |
Phase 2 | |
Phase 3 |
Tag | Purpose |
---|---|
<table> | Defines the table |
<tr> | Table row |
<th> | Table header (bold + centered by default) |
<td> | Table data (cell content) |
<caption> | Defines a table caption |
<colgroup> | Specifies a group of one or more columns in a table for formatting |
<col> | Specifies column properties for each column within a (colgroup) element |
<thead> | Groups the header content in a table |
<tbody> | Groups the body content in a table |
-Specify a valid MRP Procedure
-Movement type 161 is not allowed