แอตทริบิวต์ส่วนหัว HTML
ความหมายและการใช้งาน
แอตทริบิวต์headers
ระบุเซลล์ส่วนหัวอย่างน้อยหนึ่งเซลล์ที่เกี่ยวข้องกับเซลล์ตาราง
นำไปใช้กับ
สามารถใช้ แอตทริบิวต์headers
กับองค์ประกอบต่อไปนี้:
องค์ประกอบ | คุณลักษณะ |
---|---|
<td> | ส่วนหัว |
<th> | ส่วนหัว |
ตัวอย่าง
ตัวอย่าง Td
ระบุ <th> องค์ประกอบแต่ละ <td> องค์ประกอบที่เกี่ยวข้องกับ:
<table>
<tr>
<th id="name">Name</th>
<th id="email">Email</th>
<th id="phone">Phone</th>
<th id="addr">Address</th>
</tr>
<tr>
<td headers="name">John Doe</td>
<td headers="email">[email protected]</td>
<td headers="phone">+45342323</td>
<td headers="addr">Rosevn 56,4300 Sandnes,Norway</td>
</tr>
</table>
Th ตัวอย่าง
ระบุ <th> องค์ประกอบแต่ละเซลล์ส่วนหัวเกี่ยวข้องกับ:
<table>
<tr>
<th id="name" colspan="2">Name</th>
</tr>
<tr>
<th headers="name">Firsname</th>
<th headers="name">Lastname</th>
</tr>
</table>
รองรับเบราว์เซอร์
แอตทริบิวต์headers
มีการสนับสนุนเบราว์เซอร์ต่อไปนี้สำหรับแต่ละองค์ประกอบ:
Element | |||||
---|---|---|---|---|---|
td | Yes | Yes | Yes | Yes | Yes |
th | Yes | Yes | Yes | Yes | Yes |