Я использую плагин jsPDF-AutoTable для создания PDF.У меня следующая структура таблицы:
<table id="TableTest" class="MainTable">
<tbody>
<tr>
<th>Vorgang</th>
<th></th>
<th style="width:80px; " >nicht<br/>relevant</th>
<th>in<br/>ordnung</th>
</tr>
<tr>
<td rowspan="2">1.</td>
<td>Durchsicht der Schaltgerätekombination</td>
<td rowspan="2">
</td>
<td rowspan="2">
</td>
</tr>
<tr>
<td>Inspection of the power switchgear and controlgear assemblies</td>
</tr>
</tbody>
ТД с текстом «Проверка силовых распределительных устройств и сборок КРУ» должен иметь стиль шрифта «курсив».Поэтому я попробовал следующий код:
doc.autoTable
({
head: [['Vorgang', ' ', 'Geprüft']],
body: allelements,
startY: 60,
font: 'times',
styles:
{
fontSize: 7,
minCellHeight: 3,
cellWidth: 'wrap'
},
willDrawCell: function(cell, data)
{
if(cell.row.cells[1].text[0] == "Inspection of the power switchgear and controlgear assemblies"){
cell.cell.styles.fontStyle = "italic";
console.log(cell);
}
},
headStyles:
{
fillColor: [55,55,55]
},
theme: "grid" //plain grid (oder freilassen)
});
doc.save('EFPruefprotokoll.pdf');
Атрибут font-style меняется, но текст в pdf не выделяется курсивом.Что я делаю не так?