【问题标题】:Using text-overflow: ellipses in an HTML table [duplicate]使用文本溢出:HTML 表格中的省略号 [重复]
【发布时间】:2017-11-09 05:35:24
【问题描述】:

我一定在这里遗漏了一些东西,但为什么我的 text-overflow: ellipses 规则在这里不能正常工作?

小提琴:https://jsfiddle.net/sgj9rv5r/

td {
    white-space: nowrap; 
    width: 50px; 
    overflow: hidden;
    text-overflow: ellipsis;
}

<table border="1">
  <tr>
    <td>
      This content should shorten to ellipses after the 50px width has been reached.
    </td>
  </tr>
</table>

【问题讨论】:

标签: html css


【解决方案1】:

按照 Michael Coker 的建议使用 max-width 可以解决此问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-06
    • 2011-12-05
    • 1970-01-01
    • 2017-07-15
    • 2017-10-03
    相关资源
    最近更新 更多