代码之家  ›  专栏  ›  技术社区  ›  roflwaffle

HTML表中具有固定宽度的两级行?

  •  0
  • roflwaffle  · 技术社区  · 14 年前

    <table width="100%" cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th>Title</th>
                <th>Description</th>
                <th>Hours</th>
                <th>Rate</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td style="width:100px"></td>
                ...
        </tbody>
    </table>
    

    这很好,但现在我想让描述出现在“标题,小时,费率”下面的一行,这样它可以更长,可能是表的宽度。像这样的:

    |    Title    |    Hours    |    Rate    |
    ------------------------------------------
    | A title     | Some hours  | A rate     |  <- This is a row
    | A long description would go here...    |  <- This is the same row
    ------------------------------------------
    So on...
    

    我还是想把它称为表中的一个“行”。这只是一个显示首选项。我需要做什么来实现这个目标?

    1 回复  |  直到 7 年前
        1
  •  3
  •   Anatoly G    14 年前

    科尔斯潘会做你想做的事。

    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td colspan="4">long description</td>
    </tr>