Html01_表格-tr/th/td区别

本文详细介绍了HTML表格中的<tr>、<th>和<td>元素。<tr>用于定义表格行,是表格结构的基础;<th>表示表格的头部单元格,通常用于显示列标题,其特性是文字加粗居中;<td>则是表格的普通数据单元格,用于展示具体的数据内容。理解这三个元素的区别对于创建规范的HTML表格至关重要。
摘要由CSDN通过智能技术生成
  • tr、th与td区别:
    • tr定义行、th表示头部、td表示单元格
    • tr不能单独存在,相当于table的属性标签,
    • th、td也应当放在tr中
    • th是粗体居中的
      在这里插入图片描述
<legend>P1</legend> <table> <tr> <th scope="row"><label>Link State</label></th> <td><span id="wr1_link">-</span></td> </tr> <tr> <th scope="row"><label>Lock State</label></th> <td><span id="wr1_lock">-</span></td> </tr> <tr> <th scope="row"><label>Sync State</label></th> <td><span id="wr1_sync">-</span></td> </tr> <tr> <th scope="row"><label>Tranceive Bytes</label></th> <td><span id="wr1_tranceive">-</span></td> </tr> <tr> <th scope="row"><label>Sync Source</label></th> <td><span id="wr1_source">-</span></td> </tr> <tr> <th scope="row"><label>Loopback Time(ps)</label></th> <td><span id="wr1_loopback">-</span></td> </tr> <tr> <th scope="row"><label>Oneway Time(ps)</label></th> <td><span id="wr1_oneway">-</span></td> </tr> <tr> <th scope="row"><label>Link Time</label></th> <td><span id="wr1_linktime">-</span></td> </tr> </table> <legend>P2</legend> <table> <tr> <th scope="row"><label>Link State</label></th> <td><span id="wr0_link">-</span></td> </tr> <tr> <th scope="row"><label>Lock State</label></th> <td><span id="wr0_lock">-</span></td> </tr> <tr> <th scope="row"><label>Sync State</label></th> <td><span id="wr0_sync">-</span></td> </tr> <tr> <th scope="row"><label>Tranceive Bytes</label></th> <td><span id="wr0_tranceive">-</span></td> </tr> <tr> <th scope="row"><label>Sync Source</label></th> <td><span id="wr0_source">-</span></td> </tr> <tr> <th scope="row"><label>Loopback Time(ps)</label></th> <td><span id="wr0_loopback">-</span></td> </tr> <tr> <th scope="row"><label>Oneway Time(ps)</label></th> <td><span id="wr0_oneway">-</span></td> </tr> <tr> <th scope="row"><label>Link Time</label></th> <td><span id="wr0_linktime">-</span></td> </tr> </table> 判断wr0_link的值 如果值为1 则让P2的表格亮一点 让P1的表格灰一点 如果值为0 则让P1的表格亮一点 P2的表格灰一点的完整代码
05-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值