3345

17 分钟

#HTML 的 <thead> 标签

HTML 的 <thead> 元素封装了一系列表格的行(<tr>),代表了它们是表格(<table>)头部的组成部分。

#属性

  • bgcolor: 此属性定义列中每个单元格的背景颜色。

#示例

<table> <caption>天气预报</caption> <thead> <tr> <th>日期</th> <th>星期</th> <th>天气</th> <th>温度</th> <th>风力</th> <th>建议</th> </tr> </thead> <tbody> <tr> <td class="date">3月12日</td> <td>周日</td> <td><span class="weather-icon">☀️</span></td> <td><span class="high-temp">22°C</span> / <span class="low-temp">22°C</span></td> <td>东风2级</td> <td>适合户外活动</td> </tr> <tr> <td class="date">3月13日</td> <td>周一</td> <td><span class="weather-icon"></span> 多云</td> <td><span class="high-temp">20°C</span> / <span class="low-temp">23°C</span></td> <td>微风1级</td> <td>适宜出行</td> </tr> <tr> <td class="date">3月114日</td> <td>周二</td> <td><span class="weather-icon">🌧️</span> 小雨</td> <td><span class="high-temp">18°C</span> / <span class="low-temp">21°C</span></td> <td>东南风3级</td> <td>记得带伞</td> </tr> </tbody> <tfoot> <tr> <td colspan="6" style="text-align: center; padding: 10px; font-size: 0.9em; color: #666;"> 数据更新时间: 2023年3月11日 19:00 </td> </tr> </tfoot> </table>

<thead>

天气预报
日期 星期 天气 温度 风力 建议
3月12日 周日 ☀️ 22°C / 22°C 东风2级 适合户外活动
3月13日 周一 多云 20°C / 23°C 微风1级 适宜出行
3月114日 周二 🌧️ 小雨 18°C / 21°C 东南风3级 记得带伞
数据更新时间: 2023年3月11日 19:00

创建于 2025/6/9

更新于 2025/6/14