我们如何在 HTML 中指定表头单元格是列、行还是多列或多行的表头?
使用 scope 属性可在 HTML 中实现表头单元格是列、行还是多列或多行的表头 −
示例
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<h2>Cricketers</h2>
<table style = "width:100%">
<caption>Indian Cricketers</caption>
<th></th>
<th scope = "col">Name</th>
<tr>
<td>1</td>
<td>Sachin Tendulkar</td>
</tr>
<tr>
<td>2</td>
<td>Virat Kohli</td>
</tr>
</table>
</body>
</html>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
安卓
Python
C 编程
C++
C#
MongoDB
MySQL
JavaScript
PHP