【问题标题】:difficulty using rowspan使用行跨度的困难
【发布时间】:2012-11-30 08:01:13
【问题描述】:

我怎样才能在这种结构中制作一个 html 表格?

+--------------+-----+--------------+
|              |     |              |
|  CONTENT-1   |     |  CONTENT-2   |
|--------------|     |--------------|
|              |     |              |
|              |     |              |
|              |     |              |
|              |     |              |
|              |     |              |
+-----------------------------------+

我尝试过在 tall 列上设置行跨度,但无法正常工作。

<table class="login_selection_button">
    <tr>
        <td>
            CONTENT-1
        </td>
        <td>
            CONTENT-2
        </td>
    </tr>
    <tr>
        <td>

        </td>
        <td rowspan="2">

        </td>
        <td>

        </td>
    </tr>
</table>

http://jsfiddle.net/KyttF/

谢谢!

【问题讨论】:

    标签: html css html-table


    【解决方案1】:

    在第一行设置具有行跨度的单元格并给它一个宽度

    http://jsfiddle.net/KyttF/1/

    <table border="1">
        <tr>
            <td>
                CONTENT-1
            </td>
            <td rowspan="2" style="width:50px;"></td>
            <td>
                CONTENT-2
            </td>
        </tr>
        <tr>
            <td>
                filler
            </td>
            <td>
                filler
            </td>
        </tr>
    </table>
    

    【讨论】:

    • 给单元格一个宽度完全独立于问题和解决方案。
    • @JukkaK.Korpela 你为什么不给出自己的答案
    【解决方案2】:

    看起来你想要这个

    <table>
      <tr>
        <td>
            content 1
        </td>
        <td rowspan="2">
        </td>
        <td>
            content 2
        </td>
      </tr>
      <tr>
        <td>
        </td>
        <td>
        </td>
      </tr>
    </table>
    

    【讨论】:

      猜你喜欢
      • 2013-01-12
      • 1970-01-01
      • 2021-07-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多