如何使用HTML/CSS画表格?

1.如何画表格?

合并行/列 <设置一个删一个多余的格子>

colspan="7" (横着的是 行,七个) ===》合并列 +输入框中的内容

rowspan="2" (竖着的是 列,两个) ===》合并行 +输入框中的内容

合并行列 <其他未设置的行列 多余的删除>

colspan="3" rowspan="2" +输入框中的内容

空格行列

colspan="3" +不输入内容就是空格

2.具体示例
<caption>第一个表格</caption>
    <table border="1">
      <thead>
        <tr>
          <th>困困</th>
          <th>困困</th>
          <th>困困</th>
        </tr>
        <tr>
            <th>困困</th>
            <th>困困</th>
            <th>困困</th>
          </tr>
          <tr>
            <th>困困</th>
            <th>困困</th>
            <th>困困</th>
          </tr>
      </thead>
    </table>

猜你喜欢

转载自blog.csdn.net/m0_74744119/article/details/128864567
今日推荐