加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

跳过HTML表格

发布时间:2020-12-14 18:27:20 所属栏目:资源 来源:网络整理
导读:说我有下表: table tr tdExample/td /tdOne/td /tr tr tdExample/td /tdTwo/td /tr tr tdExample/td /tdThree/td /tr tr !-- Here I want to skip the first td cell; use only second. Example: td(empty,possibly nbsp;)/td tdblah blah blah/td -- /tr/t
说我有下表:
<table>
  <tr>
    <td>Example</td>
    </td>One</td>
  </tr>
  <tr>
    <td>Example</td>
    </td>Two</td>
  </tr>
  <tr>
    <td>Example</td>
    </td>Three</td>
  </tr>
  <tr>
    <!--
    Here I want to skip the first <td> cell; use only second. Example:
    <td>(empty,possibly &nbsp;)</td>
    <td>blah blah blah</td>
    -->
  </tr>
</table>

如果您在最后一行中阅读了我的评论,您可以看到在最后一行中我想要在表格的第二列中显示某些内容,其中第一列为空.我该怎么做呢?

作为旁注,我在this SO question中阅读了问题/答案,但是colspan与我想要的不同.我也不熟悉css空单元,所以如果这是一个解决方案,请提供一些示例代码.

解决方法

HTML
<tr>
   <td></td>
   <td>content here</td>
</tr>

CSS

table {empty-cells:show;}

保留< td>空的,没有理由在那里放一个空间. &安培; NBSP;有时可能会有点滑稽,特别是在表格中.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读