【发布时间】:2022-01-20 03:43:05
【问题描述】:
我正在使用 react-html-to-excel 将我的表格转换为 excel,但我想要的是不要将第一列导出到 excel 即第一列不应该导出到 excel 我已经阅读了 this library i am using 的文档但没有'没有找到任何东西
我的代码
<div className="App">
<ReactHTMLTableToExcel
id="test-table-xls-button"
className="download-table-xls-button"
table="table-to-xls"
filename="test"
sheet="tablexls"
buttonText="Download as XLS"
/>
<table id="table-to-xls">
<thead>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
</thead>
<tbody>
{data.map(item => (
<tr>
<td>{item.firstname}</td>
<td>{item.lastname}</td>
<td>{item.age}</td>
</tr>
))}
</tbody>
</table>
</div>
Link of codesand box full code
如果这个库不支持它,那么我愿意使用任何其他做这些事情的库。
【问题讨论】:
-
第一列是名字或吉尔
-
@MohammadAliRony 第一列表示整个第一列,例如她的名字、吉尔、大卫、尼克,我不想导出该列
标签: javascript excel reactjs