【发布时间】:2015-04-07 06:31:20
【问题描述】:
我在网上唯一能找到的方法是here,但我仍然很困惑,无法弄清楚。
我基本上有一个基于 javascript 的表格,我希望某些字段包含带有图像或简单字形图标的链接。
例如字段sheet1,sheet2,sheet3我想包含PDF图标的图像或字形,因为它们是PDF等等,它们将链接到实际文件。
我找到的大多数关于如何做到这一点的文章都是关于静态表的,因为我的文章是动态的,我很难找到这方面的信息。
我什至不知道从哪里开始,任何可以为我指明正确方向的想法都会很棒。
jquery/bootstrap
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
$('#table-javascript').bootstrapTable({
method: 'get',
url: 'bootstrap_database.php',
height: 600,
cache: false,
striped: true,
pagination: true,
search: true,
pageSize: 20,
pageList: [20, 40, 60, 100, 200],
minimumCountColumns: 2,
clickToSelect: true,
columns: [{
field: 'title',
title: 'Title',
align: 'center',
sortable: true
},{
field: 'audio',
title: 'Audio',
align: 'center',
sortable: true
},{
field: 'sheet1',
title: 'Sheet 1',
align: 'center',
sortable: true
},{
field: 'sheet2',
title: 'Sheet 2',
align: 'center',
sortable: true
},{
field: 'sheet3',
title: 'Sheet 3',
align: 'center',
sortable: true
},{
field: 'lyrics',
title: 'Lyrics',
align: 'center',
sortable: true
},{
field: 'sheet1notes',
title: 'Notes 1',
align: 'center',
sortable: true
},{
field: 'sheet2notes',
title: 'Notes 2',
align: 'center',
sortable: true
},{
field: 'sheet3notes',
title: 'Notes 3',
align: 'center',
sortable: true
}]
});
});
HTML
<div class="container">
<section>
<div class="row">
<h1>Music</h1>
<table id="table-javascript" class="table"></table>
</div>
</section>
</div>
【问题讨论】:
-
请参阅"Should questions include “tags” in their titles?",其中的共识是“不,他们不应该”!
标签: jquery twitter-bootstrap bootstrap-table