我正在使用制表器版本4.3,并尝试使用打印功能打印一个表格(其中包含columnCalcs: both)。我设置了printCopyStyle:true,但打印的输出不包括脚注行(表格底部的列计算);而且设置为右的数字对齐不会显示为右对齐。页脚和对齐方式在制表器表格中正确显示,但在打印副本中不正确显示。
请查看jsfiddle here。
是这些功能不可用,还是我遗漏了什么?
发布于 2019-07-24 22:14:42
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>
https://stackoverflow.com/questions/57158498
复制相似问题