ใช้แท็ก HTML
ในการเพิ่มส่วนท้ายลงในตาราง เท้า แท็กใช้ร่วมกับ tbody แท็กและ thead ในการกำหนดแต่ละส่วนของตาราง (ส่วนหัว ส่วนท้าย เนื้อหา)ต่อไปนี้คือคุณลักษณะ −
| แอตทริบิวต์ | ค่า | คำอธิบาย |
|---|---|---|
| align | ขวา ซ้าย ศูนย์ ให้เหตุผล char | เลิกใช้ - การจัดตำแหน่งภาพ |
| ถ่าน | ตัวอักษร | เลิกใช้ − ระบุอักขระที่จะจัดแนวข้อความ ใช้เมื่อ align ="char" |
| charoff | พิกเซลหรือ % | เลิกใช้ − ระบุออฟเซ็ตการจัดตำแหน่ง (เป็นพิกเซลหรือค่าเปอร์เซ็นต์) กับอักขระตัวแรกตามที่ระบุด้วยแอตทริบิวต์ถ่าน ใช้เมื่อ align ="char" |
| valign | top กลาง ล่าง พื้นฐาน | เลิกใช้งานแล้ว - การจัดตำแหน่งแนวตั้ง |
ตัวอย่าง
คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อสร้างส่วนท้ายของตารางใน HTML −
<!DOCTYPE html>
<html>
<head>
<style>
table, td {
border: 1px solid black;
}
</style>
</head>
<body>
<table style = "width:100%">
<thead>
<tr>
<td colspan = "4">This is the head of the table</td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan = "4">This is the footer of the table</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
<tbody>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
<tr>
...more rows here containing four cells...
</tr>
</tbody>
</table>
</body>
</html>