';
// Data
$rows = collectRows($table);
$($rows).each(function () {
const $row = $(this);
trData = '';
ForEachVisibleCell(this, 'td,th', rowIndex, $head_rows.length + $rows.length,
function (cell, row, col) {
if (cell !== null) {
let tdValue = parseString(cell, row, col);
let tdStyle = '';
let tdCss = $(cell).attr('data-tableexport-msonumberformat');
if (typeof tdCss === 'undefined' && typeof defaults.mso.onMsoNumberFormat === 'function')
tdCss = defaults.mso.onMsoNumberFormat(cell, row, col);
if (typeof tdCss !== 'undefined' && tdCss !== '')
tdStyle = 'style="mso-number-format:\'' + tdCss + '\'';
if (defaults.mso.styles.length) {
const cellStyles = document.defaultView.getComputedStyle(cell, null);
const rowStyles = document.defaultView.getComputedStyle($row[0], null);
for (let cssStyle in defaults.mso.styles) {
tdCss = cellStyles[defaults.mso.styles[cssStyle]];
if (tdCss === '')
tdCss = rowStyles[defaults.mso.styles[cssStyle]];
if (tdCss !== '' && tdCss !== '0px none rgb(0, 0, 0)' && tdCss !== 'rgba(0, 0, 0, 0)') {
tdStyle += (tdStyle === '') ? 'style="' : ';';
tdStyle += defaults.mso.styles[cssStyle] + ':' + tdCss;
}
}
}
trData += ' 0)
trData += ' colspan="' + tdColspan + '"';
const tdRowspan = getRowspan(cell);
if (tdRowspan > 0)
trData += ' rowspan="' + tdRowspan + '"';
if (typeof tdValue === 'string' && tdValue !== '') {
tdValue = preventInjection(tdValue);
tdValue = tdValue.replace(/\n/g, ' ');
}
trData += '>' + tdValue + ' | ';
}
});
if (trData.length > 0)
docData += '' + trData + '
';
rowIndex++;
});
if (defaults.displayTableName)
docData += ' |
|
' + parseString($(' ' + defaults.tableName + ' ')) + ' |
';
docData += '