HTML <colgroup> สแป น แอตทริบิวต์
ตัวอย่าง
ตั้งค่าสีพื้นหลังของสองคอลัมน์แรกโดยใช้แอตทริบิวต์ span <colgroup>:
<table>
<colgroup span="2" style="background:red"></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>
<tr>
<td>5869207</td>
<td>My first CSS</td>
<td>$49</td>
</tr>
</table>
ความหมายและการใช้งาน
แอตทริบิวต์
span
กำหนดจำนวนคอลัมน์ที่
<colgroup>
องค์ประกอบควรขยาย
เคล็ดลับ:ในการกำหนดคุณสมบัติต่างๆ ให้กับคอลัมน์ภายใน a
<colgroup>
ให้ใช้<col>
แท็กภายใน
<colgroup>
แท็ก
รองรับเบราว์เซอร์
Attribute | |||||
---|---|---|---|---|---|
span | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
<colgroup span="number">
ค่าแอตทริบิวต์
Value | Description |
---|---|
number | Sets the number of columns a column group should span |
❮ แท็ก HTML <colgroup>