Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 表列文本溢出省略号(宽度单位%)_Css_Html - Fatal编程技术网

Css 表列文本溢出省略号(宽度单位%)

Css 表列文本溢出省略号(宽度单位%),css,html,Css,Html,我有这个手机的标记 <table> <tr> <td style="width:60%"> <div class="ellipsis"> Test bla bla </div> </td> <td style="width:40%"> </td> </tr> 截断没有按预期工作,而是根据内容展开列 表布局:固定使两列相等 有什么建议吗?谢谢 请使用以下css使css3截断与表一起工作 t

我有这个手机的标记

<table>
<tr>
<td style="width:60%">
<div class="ellipsis">
Test bla bla
</div>
</td>
<td style="width:40%">
</td>
</tr>
截断没有按预期工作,而是根据内容展开列

表布局:固定使两列相等


有什么建议吗?谢谢

请使用以下css使css3截断与表一起工作

table {
   width: 200px; /*specify a width*/
   table-layout:fixed;
}

属性“table layout:fixed”对于为表中的任何块级元素执行文本截断似乎很重要。

table layout:fixed;如果宽度以%表示,则使列大小相等。甚至桌子的宽度都是流线型的。我的建议是不要使用桌子。是的,布雷特。经过大量的搜索,我放弃了这张桌子,使用了ul,它工作起来很有魅力。我的评论有什么意义吗P
table {
   width: 200px; /*specify a width*/
   table-layout:fixed;
}