要截断表格行内的长文本,请使用以下CSS-
.table td.demo { max-width: 177px; } .table td.demo span { overflow: hidden; text-overflow: ellipsis; display: inline-block; white-space: nowrap; max-width: 100%; }
以下是HTML-
<td class = "demo"> <span>This is demo text and we have made it a long text for a demo.</span> </td>