ข้อมูลอ้างอิง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 <col> สแปนแอตทริบิวต์

❮ แท็ก HTML <col>

ตัวอย่าง

ในที่นี้ สองคอลัมน์แรกควรมีสีพื้นหลังเป็นสีแดง:

<table>
  <colgroup>
    <col span="2" style="background-color:red">
    <col style="background-color:yellow">
  </colgroup>
  <tr>
    <th>ISBN</th>
    <th>Title</th>
    <th>Price</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>My first HTML</td>
    <td>$53</td>
  </tr>
</table>

ความหมายและการใช้งาน

แอตทริบิวต์ spanกำหนดจำนวนคอลัมน์ที่ <col>องค์ประกอบควรขยาย


รองรับเบราว์เซอร์

Attribute
span Yes Yes Yes Yes Yes

ไวยากรณ์

<col span="number">

ค่าแอตทริบิวต์

Value Description
number Sets the number of columns a <col> element should span

❮ แท็ก HTML <col>