handsontable合并单元格

作者 : admin 本文共819个字,预计阅读时间需要3分钟 发布时间: 2024-06-5 共2人阅读
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.css">
</head>
<body>
<div id="example"></div>
<script type="text/javascript" src="http://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.js"></script>
<script>
const container = document.querySelector('#example');
const hot = new Handsontable(container, {
data: [
['', 'Tesla', 'Volvo', 'Toyota', 'Ford'],
['2019', 10, 11, 12, 13],
['2020', 20, 11, 14, 13],
['2021', 30, 15, 12, 13]
],
rowHeaders: true,
colHeaders: true,
height: 'auto',
autoWrapRow: true,
autoWrapCol: true,
licenseKey: 'non-commercial-and-evaluation', // for non-commercial use only
mergeCells: [{
row: 1,
col: 1,
rowspan: 2,
colspan: 2
}]
});
</script>
</body>
</html>

handsontable合并单元格插图

本站无任何商业行为
个人在线分享 » handsontable合并单元格
E-->