Twitter bootstrap 如何使用排序图标显示引导表
我是新手,我需要在表格标题附近显示一个带有向上和向下排序箭头的表格。这是我的桌子结构Twitter bootstrap 如何使用排序图标显示引导表,twitter-bootstrap,twitter-bootstrap-3,Twitter Bootstrap,Twitter Bootstrap 3,我是新手,我需要在表格标题附近显示一个带有向上和向下排序箭头的表格。这是我的桌子结构 <table class="table table-bordered table-striped"> <thead> <tr> <th><b>#</b> <i class='icon-arrow-up'></i><i class='icon-arrow-
<table class="table table-bordered table-striped">
<thead>
<tr>
<th><b>#</b> <i class='icon-arrow-up'></i><i class='icon-arrow-down'></th> **// tried**
<th ><b>Name</b></th>
<th><b>Email</b></th>
<th><b>Team</b></th>
<th ><b>Role</b></th>
<th ><b>Timezone</b></th>
<th><b>Connections</b></th>
<th><b># Posts available</b></th>
<th><b>Last Login</b></th>
<th><b>Posts</b></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
#***//尝试过**
名称
电子邮件
团队
角色
时区
连接
#现有员额
最后登录
帖子
我想显示类似下图的向上/向下排序箭头。
请帮我解决这个问题。非常感谢你的帮助。多谢各位 您可以尝试使用FontAwesome。它包含一个排序图标() 要做到这一点,你必须
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
希望有帮助。将此图标与引导(glyphicon)一起使用:
引导4 您可以使用以下选项的组合:
fa V形向下,fa V形向上
fa排序、fa排序
一些文本或图标
到目前为止,您尝试了什么?您没有javascript来进行排序,因此任何图标都是完全静态的。@LegostrMotropr感谢您的快速回复。我试过使用tag,但它没有显示任何箭头。fa sort asc
和fa sort desc
在您想要显示方向时也很有用=)scotch.io有一篇很好的文章,我曾用它来制作角度翻转的自定义排序箭头。现在,在font awesome v5.3.1“fas fa sort up”和“fas fa sort down”中,字体awesome的上升和下降箭头分别为fa sort up
和fa sort down
。这会破坏你的生活UX@AkshayPethani我不理解你的评论,你能详细说明一下吗?@kiltek我的意思是,这不是获得排序图标的推荐方式。相反,你可以使用@AkshayPethani,这毫无意义,在Bootstrap3中没有字体。你只有glyphicon,没有必要仅仅为了对图标进行排序而引入一个全新的图标包。Glyphicons图标字体已经从Bootstrap 4中删除。
<th><b>#</b> <i class="fa fa-fw fa-sort"></i></th>
<span class="glyphicon glyphicon-triangle-bottom"></span>
<span class="glyphicon glyphicon-triangle-top"></span>
<th class="text-center">
<div class="btn-group" role="group">
<button type="button" class="btn btn-xs btn-link py-0 pl-0 pr-1">
Some Text OR icon
</button>
<div class="btn-group-vertical">
<a href="?sort=asc" class="btn btn-xs btn-link p-0">
<i class="fas fa-sort-up"></i>
</a>
<a href="?sort=desc" class="btn btn-xs btn-link p-0">
<i class="fas fa-sort-down"></i>
</a>
</div>
</div>
</th>