【发布时间】:2016-04-06 00:10:51
【问题描述】:
我正在从数据库中获取一些数据并将它们显示在表格中。我需要当任何列值将文本字符超过某个特定长度时,它将显示到该长度,其他将被替换为点 (i.e-.....)。
我在下面提供我的代码。
<table class="table table-bordered table-striped table-hover" id="dataTable" >
<thead>
<tr>
<th>Sl. No</th>
<th>Specification</th>
</tr>
</thead>
<tbody id="detailsstockid">
<tr ng-repeat="pro in productDataList">
<td>{{$index+1}}</td>
<td>{{pro.specification}}</td>
</tr>
</tbody>
</table>
在Specification 的上述代码中包含一些段落。我需要在这里paragraph 应该显示最多30 字符,如果超过了剩余的文本将替换为....。
【问题讨论】:
-
到目前为止你尝试过什么? 1s 谷歌搜索后:1.sparkalow.github.io/angular-truncate 2.docs.angularjs.org/api/ng/filter/limitTo 等等
标签: javascript angularjs