Handsontable:关闭自动调整大小的行(如何设置固定的高度?)
问题描述:
自动调整大小的行为在handsontable中有点不寻常。我只想为所有行添加固定的行高,除非单击它,否则将其手动拖放,就像在Excel中一样。我也想手动将所有行的高度设置为相同的高度,而不是根据最高行计算高度。Handsontable:关闭自动调整大小的行(如何设置固定的高度?)
我已经试过:
添加'height' => 50
到我的专栏,增加manualRowResize: true
,并与manualRowResize: [50, 50, 50]
增加在固定高度的几行,但是当我的数据跨越多行(例如,在HTML渲染) ,它不会停留在一个固定的高度。
答
Handsontable - Resizing rows and columns
也许rowHeights
是你想要的。
var
container = document.getElementById('example1'),
hot;
hot = new Handsontable(container, {
data: Handsontable.helper.createSpreadsheetData(200, 10),
rowHeaders: true,
colHeaders: true,
colWidths: [55, 80, 80, 80, 80, 80, 80],
rowHeights: [50, 40, 100], // <-- this one sets fixed row height
manualColumnResize: true,
manualRowResize: true
});