HTML表格单元格填充

时间:2016-01-30 21:12:52

标签: html

我在table1的td里面有table2

我希望桌子2的tds占据全高

我在这里添加了一个问题示例: https://jsfiddle.net/s1t0jd80/

<table align="center" style="width:100%" cellspacing="0" cellpadding="0" class="Yellow">
        <tbody>
        <tr>
          <td>hj</td>
        </tr>
            <tr class="Orange">
                <td class="White">
                    <table class="Blue">
                      <tr>
                        <td class="">
                          hhhh
                        </td>
                        <td class="Red">
                          hhhh2
                        </td>
                    </table>
                </td>
            </tr>
            <tr>
              <td>yyg</td>
            </tr>
        </tbody>
    </table>

请注意,橙色等级的高度为50

1 个答案:

答案 0 :(得分:1)

.White类更改为此以消除间距:

.White{
  height: 100%;
  background-color:white;
}

如果要指定高度,请进行以下更改:

.White{
  height: 200px; /* or whatever you want */
  background-color:white;
}

.Blue{
    height: 100%;
    background-color: blue;
}

Fiddle