Изменение полей страницы XLS при экспорте HTML-таблицы с использованием JavaScript - PullRequest
0 голосов
/ 15 февраля 2019

Я экспортирую HTML-таблицу, используя JavaScript.

Мне нужно изменить сгенерированные поля xls.По умолчанию используются поля обычного типа.

Установка полей в таблице не работает.

function download_xls() {
var xls=""; 
xls+='<table style="width:100%" margin:"0" border="0" padding="5" 
cellspacing="0" cellpadding="0"><tr height="20"px; style="border:0px;" >\
<td style="height:20px; width: 90px; border-top: solid 1px #000000; border- 
bottom: solid 1px #000000; border-right: solid 1px #000000; border-left: 
solid 1px #000000; font-size: 10px; font-family:Arial; color:#000000; text- 
align: left; ">IDENTIFICATION;N</td>\
<td style="height:20px; width: 97px; border-top: solid 1px #000000; border- 
bottom: solid 1px #000000; border-right: solid 1px #000000; border-left: 
solid 1px #000000; font-size: 10px; font-family:Arial; color:#000000; font- 
weight: bold; text-align: left; ">TAG</td>\
<td style="height:20px; width: 99px; border-top: solid 1px #000000; border- 
bottom: solid 1px #000000; border-right: solid 1px #000000; border-left: 
solid 1px #000000; font-size: 10px; font-family:Arial; color:#000000; font- 
weight: bold; text-align: left; "></td>\
<td style="height:20px; width: 27px; border-top: solid 1px #000000; border- 
bottom: solid 1px #000000; border-right: solid 1px #000000; border-left: 
solid 1px #000000; font-size: 10px; font-family:Arial; color:#000000; text- 
align: center; ">REV</td>\
</tr>\
</table>'

var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:application/vnd.ms-excel,' + escape(xls);
hiddenElement.target = '_blank';
hiddenElement.download = 'PT.xls';
hiddenElement.click();

}
download_xls();
...