html - 表格中的 TH 是否允许使用标题?
问题描述
表格中的 TH 是否允许使用标题?我读到他们不是,但我的灯塔审计没有选择他们。
<table>
<thead>
<tr>
<th colspan="2"><h2>The table header</h2></th>
</tr>
</thead>
<tbody>
<tr>
<td>The table body</td>
<td>with two columns</td>
</tr>
</tbody>
</table>
解决方案
<!DOCTYPE html>
<html>
<head>
<title>demo</title>
</head>
<body>
<table border="2">
<caption>Yes heading tags are allowed</caption>
<thead>
<tr>
<th><h1>Hello</h1></th>
</tr>
</thead>
<tbody>
<tr>
<td>Hi, How are you...</td>
</tr>
</tbody>
</table>
</body>
</html>
推荐阅读
- javascript - 引导列表组:将两个或多个列表组与只有一个活动选择组合
- c# - 如果动态满足条件,如何添加到 linq 查询表达式
- python - 在 CentOS 上安装 python3
- python - 在python中,如何检查与一组值相关的不确定性是否正态分布?
- vba - 使用文件和缩略图填充列表视图表单
- python-3.x - ImportError:.Elf 文件中没有名为“PyQt4”的模块
- flask - flask_wtf.file 中的 FileField 不是 werkzeug.datastructures.FileStorage 的实例
- typescript - 打字稿在返回嵌套对象时不返回嵌套类型
- html - 如何在 100vh 页面上禁用移动设备上的垂直滚动?
- excel - 使用 VBA 将多个单元格粘贴到一个单元格中