这里我有一个数据表 http://jsbin.com/aMAQUWe/1/edit
代码:
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['table']});
google.setOnLoadCallback(drawTable);
function drawTable() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('number', 'Salary');
data.addColumn('boolean', 'Full Time Employee');
data.addRows([
['Mike', {v: 10000, f: '$10,000'}, true],
['Jim', {v:8000, f: '$8,000'}, false],
['Alice', {v: 12500, f: '$12,500'}, true],
['Bob', {v: 7000, f: '$7,000'}, true]
]);
var table = new google.visualization.Table(document.getElementById('table_div'));
table.draw(data, {showRowNumber: true});
}
</script>
</head>
<body>
<div id='table_div'></div>
</body>
</html>
有什么方法可以将 twitter bootstrap 设计添加到这个表中吗?
最佳答案
你检查过Tables了吗? Bootstrap 中的文档?这将告诉您如何设置表格效果。
我想您需要动态插入 CSS 规则来构建表格,例如,使用 <table>
而不是 <div>
.
关于html - Bootstrap 样式设计到表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21366488/