如何在二维数组幻灯片中的 pptxgenjs 上制作无边框 table

How to make a borderless table on pptxgenjs in 2d array slide

我正在使用 pptgenjs 创建演示文稿,但是我似乎无法创建我想要的 table 边框。

这是我要使用的数据:

let rows = [
   ["data1","data2"],
   ["data3","data4"],
   ["data5","data6"],
]

这是我到目前为止尝试过的:

let arrBorder = [null,null,{color:'DA70D6'},null]
slide.addTable(rows,{rowH:1,border:arrborder})

在我尝试的方法中,在 table 的顶部、左侧和右侧创建一个空值,而底部有一条线,结果是:

然而我想要的是:

关于如何让它发挥作用有什么建议吗?

根据他们的 table documentation,我认为它是这样组合的:

const col2cellstyle = {border: [null, null, {color:'DA70D6'}, null]};
const table = rows.map(row => row.map((value, col) => ({
  text: value,
  options: col == 1 ? col2cellstyle : null;
})));
slide.addTable(table, {rowH: 1});

输入 .addTable 的结果数据结构如下所示:

[
  [
    {text: "data1", options: null}, 
    {text: "data2", options: {border: [null, null, {color:'DA70D6'}, null]}},
  ],
  [
    {text: "data3", options: null}, 
    {text: "data4", options: {border: [null, null, {color:'DA70D6'}, null]}},
  ],
  [
    {text: "data5", options: null}, 
    {text: "data6", options: {border: [null, null, {color:'DA70D6'}, null]}},
  ],
]