bootstrap table 表格太宽,设置的width属性不起作用怎么办
1个回答
展开全部
<html>
<head>
<meta charset="utf-8"/>
<script src="../scripts/jquery-2.1.1.min.js"></script>
<script src="../scripts/bootstrap.min.js"></script>
<script src="../scripts/bootstrap.js"></script>
<script src="../scripts/handsontable.full.min.js"></script>
<link href="../styles/handsontable.full.css" rel="stylesheet" />
<title>hansontable</title>
<script type="text/javascript">
var colorRenderer = function (instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);
td.style.backgroundColor = '#EEEEEE';
td.style.height = '40px';
};
var common_columns = [{ renderer: colorRenderer }, { type: 'dropdown', source: ['1', '2'] }];
var common_colWidths = [100, 140];
var hot1; var hand1;
$(function () { getTable(); });
var common_data;
//得到数据
function getHotData() {
var temp = [getMyData(document.getElementById("hand1"))];
for (var i = 0; i < temp.length; i++) {
common_data[i] = temp[i];
}
return [JSON.stringify(common_data[0])];
}
function show() {
alert(1);
};
var common_colHeaders = ['标题', '标题2'];
//数据表格
function getTable() {
hand1 = document.getElementById('hand1');
hand1.innerHTML = "";
hot1 = new Handsontable(hand1, {
colWidths: [100, 93],
colHeaders: true,
colHeaders: ['标题', '标题2'],
// data: common_data[0],
columns: [{}, { type: 'dropdown', source: ['1', '2'] }],
//columns: common_columns,
fixedColumnsLeft: 7,
maxRows: 1,
//contextMenu: ['remove_row'],
outsideClickDeselects: false
});
}
</script>
</head>
<body>
<div id="hand1" class="handsontable" onclick="show()"></div>
</body>
</html>
我的handsontable例子,自己写的
<head>
<meta charset="utf-8"/>
<script src="../scripts/jquery-2.1.1.min.js"></script>
<script src="../scripts/bootstrap.min.js"></script>
<script src="../scripts/bootstrap.js"></script>
<script src="../scripts/handsontable.full.min.js"></script>
<link href="../styles/handsontable.full.css" rel="stylesheet" />
<title>hansontable</title>
<script type="text/javascript">
var colorRenderer = function (instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);
td.style.backgroundColor = '#EEEEEE';
td.style.height = '40px';
};
var common_columns = [{ renderer: colorRenderer }, { type: 'dropdown', source: ['1', '2'] }];
var common_colWidths = [100, 140];
var hot1; var hand1;
$(function () { getTable(); });
var common_data;
//得到数据
function getHotData() {
var temp = [getMyData(document.getElementById("hand1"))];
for (var i = 0; i < temp.length; i++) {
common_data[i] = temp[i];
}
return [JSON.stringify(common_data[0])];
}
function show() {
alert(1);
};
var common_colHeaders = ['标题', '标题2'];
//数据表格
function getTable() {
hand1 = document.getElementById('hand1');
hand1.innerHTML = "";
hot1 = new Handsontable(hand1, {
colWidths: [100, 93],
colHeaders: true,
colHeaders: ['标题', '标题2'],
// data: common_data[0],
columns: [{}, { type: 'dropdown', source: ['1', '2'] }],
//columns: common_columns,
fixedColumnsLeft: 7,
maxRows: 1,
//contextMenu: ['remove_row'],
outsideClickDeselects: false
});
}
</script>
</head>
<body>
<div id="hand1" class="handsontable" onclick="show()"></div>
</body>
</html>
我的handsontable例子,自己写的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询