首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >打印功能的制表器输出不包括表尾列计算和文本对齐

问打印功能的制表器输出不包括表尾列计算和文本对齐
EN

Stack Overflow用户
提问于 2019-07-23 15:07:07
回答 1查看 207关注 0票数 0

我正在使用制表器版本4.3,并尝试使用打印功能打印一个表格(其中包含columnCalcs: both)。我设置了printCopyStyle:true,但打印的输出不包括脚注行(表格底部的列计算);而且设置为右的数字对齐不会显示为右对齐。页脚和对齐方式在制表器表格中正确显示,但在打印副本中不正确显示。

请查看jsfiddle here。

是这些功能不可用,还是我遗漏了什么?

EN

回答 1

Stack Overflow用户

发布于 2019-07-24 22:14:42

​

代码语言:javascript
复制
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"
    },
  ],
});
代码语言:javascript
复制
<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>

​

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57158498

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档