使用table_to_book方法导出并下载文件时,如何在excel文件中添加border样式? #3076

Closed
opened 2024-02-18 09:37:16 +00:00 by 767746649zyy · 1 comment

你好,当我使用table_to_book方法导出并下载文件时,table的border样式没有加进去。
代码:

<table border={1} id="excel">
        <tbody>
          <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
          </tr>
          <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
          </tr>
        </tbody>
      </table>
  const dom_element = document.getElementById("excel");
  const workbook = XLSX.utils.table_to_book(dom_element, {
      cellStyles: true,
    });
  XLSX.writeFileXLSX(
      workbook,
      `demo.xlsx`
    );
你好,当我使用table_to_book方法导出并下载文件时,table的border样式没有加进去。 代码: ``` <table border={1} id="excel"> <tbody> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> </tbody> </table> ``` ``` const dom_element = document.getElementById("excel"); const workbook = XLSX.utils.table_to_book(dom_element, { cellStyles: true, }); XLSX.writeFileXLSX( workbook, `demo.xlsx` ); ```
Owner

Cell border styling requires SheetJS Pro. We hope to add styling to SheetJS CE but do not know the timeframe.

Cell border styling requires [SheetJS Pro](https://sheetjs.com/pro/). We hope to add styling to SheetJS CE but do not know the timeframe.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#3076
No description provided.