0

私は自分の td に次のコードを試しましたが、良い兆候はありません。

.td_class{
max-width:100px;
overflow: hidden;
text-overflow : ellipsis;
-ms-text-overflow : ellipsis; 
}

助けはありますか?

4

3 に答える 3

0

これを試して、

td
{
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
于 2013-10-07T09:42:16.820 に答える
0

<th>追加の要素でテキストをラップし、それに and を適用するwidthと、機能overflowします。

http://jsfiddle.net/nkLav9f7/6/

<table>
    <thead>
        <tr>
            <th><span>This is a really long header</span></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>foo</td>
        </tr>
    </tbody>
</table>

table, td { border: solid 1px black }

th
{
    max-width: 50px;
}

span
{
    overflow: hidden;
    display: block;
    width: 50px;
    white-space: nowrap;
    text-overflow: ellipsis;
}
于 2014-09-18T16:40:18.933 に答える