私は、2つのテーブルの情報を並べて表示するためにAutotableを使用しようとしています。多くのエントリーがなく、情報が1ページしか必要ない場合、それはうまく表示されます。しかし、多くのデータと複数のページがある場合、最初のテーブルがほとんどのエントリを表示するまで、2番目のテーブルは表示されません。JsPDF Autotable:複数のページにまたがる2つのテーブルを並べて表示するにはどうすればよいですか?
JsFiddleには、この問題を説明するサンプルデータがあります。私は2番目のテーブルのy位置を変更しようとしましたが、表示しているページでデータを上に移動して、前のページに移動するのではなく、データの上端を切り取っているようです。
function generatePdf() {
header = ["Reason","Duration","Start time"];
content = [
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"],
["Analyzer blowback","10h15m","08:04"]
];
var doc = new jsPDF('p', 'pt');
doc.autoTable(header, content, {
showHeader: 'firstPage',
styles: { fontSize: 10 },
avoidPageSplit: true,
margin: { right: 305 }
});
doc.autoTable(header, content, {
showHeader: 'firstPage',
styles: { fontSize: 10 },
avoidPageSplit: true,
margin: { left: 305 }
});
doc.save("test.pdf")
}
generatePdf();
私は3つのテーブルを上下に配置する必要がある場合 – Smith