如何使用 AutoTable 创建不规则 table

How to create an irregular table using AutoTable

使用 jspdf-autotable。我如何创建一个 table 的列,该列与其他列相比具有垂直偏移?类似于本例中的长度列:

我今天的table是用下面的代码构建的,但我不知道做垂直偏移。

doc.autoTable({
  head: [['Name', 'Slack (m)', 'Length (m)']],
  body: rows,
  tableWidth: doc.internal.pageSize.getWidth() * 0.33,
  startY: 161,
  margin: {left: 400},
  styles: {fontSize: 8, lineWidth: 1},
  rowPageBreak: 'avoid',
  didDrawPage: pageNumber
});

我找不到任何方法来通过编辑 autoTable 中的样式来进行垂直偏移。我没有使用 autoTable 创建 table,而是只需要在 for 循环中绘制很多框,所有这些框放在一起看起来就像 table。