首页 > 解决方案 > 如何在 Tabulator 的 PDF 导出中设置列宽

问题描述

我一直在尝试在 Tabulator 中设置 PDF 导出的列宽。使用http://tabulator.info/docs/4.5/download#pdfhttps://github.com/simonbengtsson/jsPDF-AutoTable#styling-options作为参考,我写了这段代码:

table.download("pdf", "data.pdf", {
    "orientation":"portrait",

    "autoTable":{
        "columnStyles": {
            "allocated_site_name": {"cellWidth": 20}
        },
        margin: {
            "top": 40,
            "right": 20,
            "bottom": 20,
            "left": 20
        }
    }
});

但是,似乎 columnStyles 被忽略了,尽管边距有效。

我做错什么了吗?

我在用:

谢谢!

标签: jspdftabulatorjspdf-autotable

解决方案


推荐阅读