- A+
所属分类:Bootstrap Table
tableExport.js
- //找到这一块代码在下面增加一行代码即可
- ForEachVisibleCell(this, 'td,th', rowIndex, $hrows.length + $rows.length,
- function (cell, row, col) {
- if (cell !== null) {
- var tdstyle = '';
- var tdcss = $(cell).data("tableexport-msonumberformat");
- if (typeof tdcss == 'undefined' && typeof defaults.onMsoNumberFormat === 'function')
- tdcss = defaults.onMsoNumberFormat(cell, row, col);
- else tdcss = '\\@';//增加这一行代码即可
- if (typeof tdcss != 'undefined' && tdcss !== '')
- tdstyle = 'style="mso-number-format:\'' + tdcss + '\'';
- for (var cssStyle in defaults.excelstyles) {
- if (defaults.excelstyles.hasOwnProperty(cssStyle)) {
- tdcss = $(cell).css(defaults.excelstyles[cssStyle]);
- if (tdcss === '')
- tdcss = $row.css(defaults.excelstyles[cssStyle]);
- if (tdcss !== '' && tdcss != '0px none rgb(0, 0, 0)' && tdcss != 'rgba(0, 0, 0, 0)') {
- tdstyle += (tdstyle === '') ? 'style="' : ';';
- tdstyle += defaults.excelstyles[cssStyle] + ':' + tdcss;
- }
- }
- }
- trData += '<td';
- if (tdstyle !== '')
- trData += ' ' + tdstyle + '"';
- if ($(cell).is("[colspan]"))
- trData += ' colspan="' + $(cell).attr('colspan') + '"';
- if ($(cell).is("[rowspan]"))
- trData += ' rowspan="' + $(cell).attr('rowspan') + '"';
- trData += '>' + parseString(cell, row, col).replace(/\n/g, '<br>') + '</td>';
- }
- });
2017年3月10日 下午2:32 沙发
你好,我的tableexport里面没有这些判断,改怎么写呢?
2017年3月10日 下午2:55 板凳
谢谢您,我的版本过低的问题。已解决
2017年3月17日 上午11:59 地板
你好,我想问下你这个是哪个版本的bootstrap-table呢~~
2017年3月17日 下午8:37 1层
@寂灭 v1.11