HTML <td> แอตทริบิวต์colspan
ตัวอย่าง
ตาราง HTML ที่มีเซลล์ตารางที่ครอบคลุมสองคอลัมน์:
<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
<tr>
<td colspan="2">Sum: $180</td>
</tr>
</table>
ความหมายและการใช้งาน
แอตทริบิวต์colspan
กำหนดจำนวนคอลัมน์ที่เซลล์ควรขยาย
รองรับเบราว์เซอร์
Attribute | |||||
---|---|---|---|---|---|
colspan | Yes | Yes | Yes | Yes | Yes |
หมายเหตุ:เฉพาะ Firefox เท่านั้นที่รองรับcolspan="0"
ซึ่งมีความหมายพิเศษ (ดูด้านล่างในตาราง "ค่าแอตทริบิวต์")
ไวยากรณ์
<td colspan="number">
ค่าแอตทริบิวต์
Value | Description |
---|---|
number | Specifies the number of columns a cell should span. Note: colspan="0" tells the browser to span the cell to the last column of the column group (colgroup) |
❮ แท็ก HTML <td>