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

❮ แท็ก HTML <th>

ตัวอย่าง

ระบุว่าเซลล์ส่วนหัวทั้งสองเป็นส่วนหัวสำหรับคอลัมน์:

<table>
  <tr>
    <th></th>
    <th scope="col">Month</th>
    <th scope="col">Savings</th>
  </tr>
  <tr>
    <td>1</td>
    <td>January</td>
    <td>$100</td>
  </tr>
  <tr>
    <td>2</td>
    <td>February</td>
    <td>$80</td>
  </tr>
</table>

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

แอตทริบิวต์scopeระบุว่าเซลล์ส่วนหัวเป็นส่วนหัวของคอลัมน์ แถว หรือกลุ่มของคอลัมน์หรือแถว

หมายเหตุ:คุณลักษณะscopeนี้ไม่มีเอฟเฟกต์ภาพในเว็บเบราว์เซอร์ทั่วไป แต่สามารถใช้โดยโปรแกรมอ่านหน้าจอ 


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

Attribute
scope Yes Yes Yes Yes Yes

ไวยากรณ์

<th scope="col|row|colgroup|rowgroup">

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

Value Description
col Specifies that the cell is a header for a column
row Specifies that the cell is a header for a row
colgroup Specifies that the cell is a header for a group of columns
rowgroup Specifies that the cell is a header for a group of rows

❮ แท็ก HTML <th>