HTML <col> span attribute

description and usage

span attribute นี้กำหนดจำนวนคอลัมน์ที่ <col> ควรข้าม

ตัวอย่าง

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

<table>
  <colgroup>
    <col span="2" style="background-color:#B0C4DE">
    <col style="background-color:#FAFAD2">
  </colgroup>
  <tr>
    <th>หมายเลขหนังสือ</th>
    <th>หัวข้อ</th>
    <th>ราคา</th>
  </tr>
  <tr>
    <td>3476896</td>
    <td>HTML ขั้นต้น</td>
    <td>$53</td>
  </tr>
</table>

ทดลองด้วยตัวเอง

syntax

<col span="number">

attribute value

value description
number ตั้งค่าจำนวนหลักคอลัมน์ที่ <col> ควรข้าม

การสนับสนุนเบราเซอร์

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
การสนับสนุน การสนับสนุน การสนับสนุน การสนับสนุน การสนับสนุน