【发布时间】:2018-04-18 09:20:59
【问题描述】:
我使用 bootstrap-table 在我的页面中显示表格,我使用 TableExport.js 、 FileSaver.js 和 .xlsx.core.min.js 库以将表格保存为 .xlslx 格式。
问题是excel下面的列显示为通用格式,导致显示的值像1,00582E+11,而右边的值是100582012421。
我尝试data-tableexport-msonumberformat="\@" 强制导出过程将此列视为文本,但结果没有改变。我还阅读了类似的question 并创建了一个CSS 类
.text{
mso-number-format:"\@";/*force text*/
}
但这个解决方案都不适合我..
<table id="mytable" class="table table-hover"
...
data-url="myfile.json"
...
>
<thead>
<tr>
...
<th data-field="productId" data-tableexport-msonumberformat="\@">Product</th>
...
</tr>
</thead>
</table>
【问题讨论】:
-
你搞定了吗?
标签: javascript excel twitter-bootstrap bootstrap-table filesaver.js