【问题标题】:How to create table with 2 rows and different no of columns [closed]如何创建具有 2 行和不同列数的表 [关闭]
【发布时间】:2012-10-01 04:33:35
【问题描述】:

我想创建一个有 2 行的表。第一行包含 2 列大小相等,第二列应包含 3 列大小相等。

是否可以在 HTML 中设计这种类型的表格?

我不想使用嵌套表;单表可以实现吗?

【问题讨论】:

  • 为什么对这个问题投反对票? downvoter,你能解释一下吗?
  • 为什么是负分???我问错了吗?
  • 投反对票可能是因为没有迹象表明研究工作,在询问之前你没有展示你自己尝试过的东西。

标签: html html-table multiple-columns


【解决方案1】:
<table border=1 width=200>
    <tr><td colspan=2>&nbsp;</td>
        <td colspan=2>&nbsp;</td>
    </tr>
    <tr><td>&nbsp;</td>
        <td colspan=2>&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
</table>

【讨论】:

    【解决方案2】:

    我的 2 美分

    <table class="mytable">
        <tr>
            <td colspan="3"></td>
            <td colspan="3"></td>
        </tr>
        <tr>
            <td colspan="2"></td>
            <td colspan="2"></td>
            <td colspan="2"></td>
        </tr>
    </table>
    

    小提琴:http://jsfiddle.net/eJ7ts/

    【讨论】:

      【解决方案3】:

      试试这个

      <table width=300 >
          <tr><td colspan=2>&nbsp;</td>
              <td colspan=2>&nbsp;</td>
          </tr>
          <tr><td>&nbsp;</td>
              <td colspan=2>&nbsp;</td>
              <td>&nbsp;</td>
          </tr>
      </table>
      

      小CSS

       td
      {
          border: 2px solid #000;
          height:50px;
      }
      

      小提琴

      http://jsfiddle.net/Ah9AE/

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-11-09
        • 1970-01-01
        • 1970-01-01
        • 2021-11-28
        • 1970-01-01
        • 1970-01-01
        • 2016-05-28
        • 2013-03-30
        相关资源
        最近更新 更多