ข้อมูลอ้างอิงHTML

HTML โดยตัวอักษร HTML ตามหมวดหมู่ รองรับ HTML Browser แอตทริบิวต์ HTML HTML Global Attributes เหตุการณ์ HTML HTML สี HTML Canvas HTML เสียง/วิดีโอ ชุดอักขระ HTML HTML Doctypes การเข้ารหัส URL HTML รหัสภาษา HTML รหัสประเทศ HTML ข้อความ HTTP วิธี HTTP ตัวแปลง PX เป็น EM แป้นพิมพ์ลัด


HTML <td> แอตทริบิวต์colspan

❮ แท็ก HTML <td>

ตัวอย่าง

ตาราง 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>