HTML rowspan Attribute
ความหมายและการใช้งาน
แอตทริบิวต์rowspan
ระบุจำนวนแถวที่เซลล์ควรขยาย
นำไปใช้กับ
สามารถใช้ แอตทริบิวต์rowspan
กับองค์ประกอบต่อไปนี้:
องค์ประกอบ | คุณลักษณะ |
---|---|
<td> | rowspan |
<th> | rowspan |
ตัวอย่าง
ตัวอย่าง Td
ตาราง HTML ที่มีเซลล์ตารางที่ครอบคลุมสองแถว:
<table>
<tr>
<th>Month</th>
<th>Savings</th>
<th>Savings for holiday!</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
<td rowspan="2">$50</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
Th ตัวอย่าง
ตาราง HTML ที่มีเซลล์ส่วนหัวที่ครอบคลุมสามแถว:
<table>
<tr>
<th>Month</th>
<th>Savings</th>
<th rowspan="3">Savings for holiday!</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>
รองรับเบราว์เซอร์
แอตทริบิวต์rowspan
มีการสนับสนุนเบราว์เซอร์ต่อไปนี้สำหรับแต่ละองค์ประกอบ:
Element | |||||
---|---|---|---|---|---|
td | Yes | Yes | Yes | Yes | Yes |
th | Yes | Yes | Yes | Yes | Yes |