【问题标题】:Export table to excel and columns to be in text format将表格导出为 excel,将列导出为文本格式
【发布时间】:2018-04-18 09:20:59
【问题描述】:

我使用 bootstrap-table 在我的页面中显示表格,我使用 TableExport.jsFileSaver.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


【解决方案1】:

在 td 中使用类 tableexport-string

<td class="tableexport-string">{{$Rep->deviceName}}</td>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多