【发布时间】:2018-02-15 03:48:17
【问题描述】:
我尝试使用word-wrap 以及向td 添加一个类来执行text-overflow: elipsis,但似乎没有什么影响这个特定的表,我最终得到了这个:
这是我的 HTML/CSS:
<div class="row">
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Family Checks: no placed instances, >1MB size, misnamed</h4>
</div>
<div class="panel-body">
<table class="table table-fixed" style="table-layout: fixed; width: 100%;">
<thead>
<th class="col-xs-1 text-center">
#
</th>
<th class="col-xs-7"><a href="" ng-click="vm.sortType = 'name'; vm.sortReverse = !vm.sortReverse">
Name
<span ng-show="vm.sortType == 'name' && !vm.sortReverse" class="glyphicon glyphicon-chevron-down"></span>
<span ng-show="vm.sortType == 'name' && vm.sortReverse" class="glyphicon glyphicon-chevron-up"></span>
</a></th>
<th class="col-xs-1 text-center"><a href="" ng-click="vm.sortType = 'instances'; vm.sortReverse = !vm.sortReverse">
Qty.
<span ng-show="vm.sortType == 'instances' && !vm.sortReverse" class="glyphicon glyphicon-chevron-down"></span>
<span ng-show="vm.sortType == 'instances' && vm.sortReverse" class="glyphicon glyphicon-chevron-up"></span>
</a></th>
<th class="col-xs-1 text-center"><a href="" ng-click="vm.sortType = 'sizeValue'; vm.sortReverse = !vm.sortReverse">
Size
<span ng-show="vm.sortType == 'sizeValue' && !vm.sortReverse" class="glyphicon glyphicon-chevron-down"></span>
<span ng-show="vm.sortType == 'sizeValue' && vm.sortReverse" class="glyphicon glyphicon-chevron-up"></span>
</a></th>
<th class="col-xs-2 text-center"><a href="" ng-click="vm.sortType = 'elementId'; vm.sortReverse = !vm.sortReverse">
Element Id
<span ng-show="vm.sortType == 'elementId' && !vm.sortReverse" class="glyphicon glyphicon-chevron-down"></span>
<span ng-show="vm.sortType == 'elementId' && vm.sortReverse" class="glyphicon glyphicon-chevron-up"></span>
</a></th>
</thead>
<tbody>
<tr ng-repeat="i in vm.AllFamilies | orderBy: vm.sortType : vm.sortReverse">
<td class="col-xs-1 text-center">{{$index}}</td>
<td class="col-xs-7 text-left">{{i.name}}</td>
<td class="col-xs-1 text-center">{{i.instances}}</td>
<td class="col-xs-1 text-center">{{i.size}}</td>
<td class="col-xs-2 text-center">{{i.elementId}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
我的css:
.table-fixed{
width: 100%;
background-color: white;
table-layout: fixed;
word-wrap: break-word;
}
.table-fixed tbody{
height: 500px;
overflow-y: auto;
width:100%;
}
.table-fixed thead, tbody, tr, td, th {
display: block;
}
.table-fixed tbody td{
float: left;
}
/*Header*/
.table-fixed thead tr th {
float: left;
background-color: #00b3ee;
border-color: #00b3ee;
}
【问题讨论】:
标签: html css twitter-bootstrap