diff --git a/src/extensions/print/bootstrap-table-print.js b/src/extensions/print/bootstrap-table-print.js index aab0a7ffba..881d9cba7a 100644 --- a/src/extensions/print/bootstrap-table-print.js +++ b/src/extensions/print/bootstrap-table-print.js @@ -70,39 +70,37 @@ } function buildTable(data, columnsArray) { - var out = ""; - for(var k = 0; k < columnsArray.length; k++) { + var html = ['
']; + for (var k = 0; k < columnsArray.length; k++) { var columns = columnsArray[k]; - out += ""; - for(var h = 0; h < columns.length; h++) { + html.push(''); + for (var h = 0; h < columns.length; h++) { if (!columns[h].printIgnore) { - out += "', columns[h].title) + ); } } - out += ""; + html.push(''); } - out += ""; - for(var i = 0; i < data.length; i++) { - out += ""; + html.push(''); + for (var i = 0; i < data.length; i++) { + html.push(''); for(var l = 0; l < columnsArray.length; l++) { var columns = columnsArray[l]; for(var j = 0; j < columns.length; j++) { if (!columns[j].printIgnore && columns[j].field) { - out += (""); + html.push(''); } } } - out += ""; + html.push(''); } - out += "
" + columns[h].title + ""); + html.push( + '%s
" + formatValue(data[i], i, columns[j]) + "', formatValue(data[i], i, columns[j]), '
"; - return out; + html.push(''); + return html.join(''); } function sortRows(data,colName,sortOrder) { if(!colName){