我正在使用Tabulator 4.3版,并尝试使用打印功能打印表(具有columnCalcs: both
)。我已经设置了printCopyStyle:true
,但是print的输出不包含页脚行(表格底部的列计算);设置为右的数字对齐也不会出现右对齐。页脚和对齐方式都正确显示在制表器表中,但不能正确显示在打印副本中。
请检查jsfiddle here。
这些功能是否不可用或我缺少什么?
答案 0 :(得分:0)
const tabledata = [{
dep: "A",
name: "Oli Bob",
score: 100
},
{
dep: "A",
name: "Jamie Newhart",
score: 120
},
{
dep: "D",
name: "Gemma Jane",
score: 90
},
{
dep: "D",
name: "James Newman",
score: 100
},
];
const table = new Tabulator("#example-table", {
height: "250px",
data: tabledata,
groupBy: "dep",
columnCalcs: "both",
printAsHtml: true,
printCopyStyle: true,
columns: [{
title: "Name",
field: "name",
width: 200
},
{
title: "Score",
field: "score",
align: "right",
bottomCalc: "sum"
},
],
});
<head>
<link href="https://unpkg.com/tabulator-tables@4.3.0/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.3.0/dist/js/tabulator.min.js"></script>
</head>
<body>
<button type="button" id="report-print" onclick="table.print();">Print </button>
<div id="example-table"></div>
</body>