html表溢出仅为td隐藏

时间:2013-02-21 15:12:04

标签: html css html-table overflow

我们所知道的是表格和第一列的宽度总和。 3列和4列必须适应内容,第2列必须使用其余空间。第二列必须设置隐藏溢出,只允许一行或一行

也许小提琴更清晰

http://jsfiddle.net/favio41/9z867/

<table>
    <colgroup>
        <col class="col1" />
        <col class="col2" />
        <col class="col3" />
        <col class="col4" />
    </colgroup>
    <tbody>
        <tr>
            <td class="date">
                <span class="month monthAndYear">Feb</span>
                <br/>
                <span class="day ng-binding">21</span>
            </td>
            <td style="background-image: url(resources/img/categories/G0400.png);" class="category_icon cat_G0400">
                <span class="concepto ng-binding">This is a example of text</span>
            </td>
            <td>
                <span data-tooltip="Internet, teléfono fijo" class="cat-label cat-tooltip onlyTitle">
                    <span class="text ng-binding">Internet</span>
                    <span class="arrow"></span>
                </span>
            </td>
            <td class="importe">
                <span class="importe_value ng-binding">-33,23</span>
            </td>
        </tr>

        <tr>
            <td class="date">
                <span class="month monthAndYear">Feb</span>
                <br />
                <span class="day ng-binding">21</span>
            </td>
            <td style="background-image: url(resources/img/categories/G0400.png);" class="category_icon cat_G0400">
                <span class="concepto ng-binding">This is a example of text, but this is really big and we want to be hidden the last part because if is too big ...</span>
                <br/>
                <span class="descripcion ng-binding">This is a example of description text</span>
            </td>
            <td>
                <span data-tooltip="Internet, teléfono fijo" class="cat-label cat-tooltip onlyTitle">
                    <span class="text ng-binding">Internet</span>
                    <span class="arrow"></span>
                </span>
            </td>
            <td class="importe">
                <span class="importe_value ng-binding">-33,23</span>
            </td>
        </tr>
</tbody>

1 个答案:

答案 0 :(得分:0)

将DIV放入要溢出的单元格中。设置DIV的尺寸和溢出,而不是TD。