我有一个表格,最后一列超出了页面。它只是溢出页面右边缘并不断延伸的一行,但您看不到它或滚动它。我正在使用语义 ui 框架。
如何将文本包含在仅最后一列的每个单元格的边界内?我不确定如何处理它,因为我需要使用 ng-repeat 来生成表数据。
我尝试添加 ng-style="overflow:scroll; max-width:300px"
到我的<td></td>
标签,但它为表格中的每个单元格应用了一个可滚动的溢出单元格。
<table class="ui left aligned red table"
ng-show="ishowError">
<thead>
<tr>
<th ng-repeat="head in headers"
ng-bind="ifixHeader(headers[$index])"></th>
</tr>
</thead>
<tbody>
<tr
ng-repeat="nfo in allError | filter:dashFilter">
<td ng-repeat="head in headers"
ng-bind="nfo[headers[$index]]">
</td>
</tr>
</tbody>
</table>
最佳答案
为什么不使用“last-child”选择器?将此添加到您的 CSS。
tr td:last-child{
overflow:scroll;
max-width:300px;
}
希望对您有所帮助。
关于javascript - 如何格式化 ng-repeat 表特定列中的单元格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37866861/