jspdf AutoTable показывает только одну строку таблицы - PullRequest
0 голосов
/ 08 апреля 2019

Я использую jsPdf для печати таблицы, используя autotable. Но я получаю только одну строку таблицы.

Я пробовал другие варианты, такие как:

doc.html, doc.addHTMl и т. Д. HTML таблица

 <table class="table table-sm" id="basic-table">
            <thead>
                <tr>
                    <th>Item</th>
                    <th>Qty</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let item of kot.itemList; let j=index">
                    <td><b [style.text-decoration]="item.quantity<=0 ? 'line-through' : 'none'"> {{item.name}} </b>
                            <span *ngIf="item.quantity<=0" style="display: block"> <b> {{item.orderNote}}</b></span>
                        <span *ngIf="item.quantity<=0" style="display: block"> <b> {{item.cancellationReason}}</b></span>
                    </td>
                    <td><b> {{ item.quantity }} </b></td>
                </tr>
            </tbody>
        </table>

jsPdf код

    var doc = new jsPDF('p', 'pt');
    doc.autoTable({html: '#basic-table'});
    doc.save('table.pdf');

Ожидаемый результат: Полные строки: Фактически: только один ряд

enter image description here

...