如何格式化 ng-repeat table 特定列中的单元格?
How to format cells in specific column of an ng-repeat table?
我有一个 table,最后一列溢出了页面。它只是溢出页面右边缘并不断延伸的一行,但您看不到它或滚动它。我正在使用语义 ui 框架。
如何将文本包含在仅最后一列的每个单元格的边界内?我不确定如何处理它,因为我需要使用 ng-repeat 来生成 table 数据。
我尝试将 ng-style="overflow:scroll; max-width:300px"
添加到我的 <td></td>
标签,但它为 table 中的每个单元格应用了一个可滚动的溢出单元格。
<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;
}
希望对您有所帮助。
我有一个 table,最后一列溢出了页面。它只是溢出页面右边缘并不断延伸的一行,但您看不到它或滚动它。我正在使用语义 ui 框架。
如何将文本包含在仅最后一列的每个单元格的边界内?我不确定如何处理它,因为我需要使用 ng-repeat 来生成 table 数据。
我尝试将 ng-style="overflow:scroll; max-width:300px"
添加到我的 <td></td>
标签,但它为 table 中的每个单元格应用了一个可滚动的溢出单元格。
<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;
}
希望对您有所帮助。