I am new in Angular using DataTable in Angular 6.
(Referred : https://l-lin.github.io/angular-datatables)
I have installed fixedcolumns.
npm install datatables.net-fixedcolumns-bs
my angular code to initialize table is
ngOnInit() {
this.dtOptions[0] = {
pagingType: 'full_numbers',
pageLength: 25,
info:"Showing _START_ to _END_ of _TOTAL_ results",
infoEmpty:"Showing 0 to 0 of 0 results",
scrollX:true,
scrollCollapse:true,
fixedColumns:{
leftColumns: 1,
rightColumns: 1
}
};
and HTML code is
<table class="table table-hover row-border hover" datatable [dtOptions]="dtOptions[0]" [dtTrigger]="dtTrigger" >
<thead>
<tr>
<th style="text-align: left">Flag/Register name</th>
<th style="text-align: left">Country/Government</th>
<th style="text-align: center">Action</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let flagView of flagViewModel">
<td>{{flagView.countryName}} </td>
<td>
<div style="text-transform: uppercase" *ngIf="flagView.flagnameOfficialOther!=null">
{{flagView.flagnameOfficialOther}}
</div>
</td>
<td style="text-align: center">
<a style="border-top:0;border-left:0;border-right:0;" [routerLink]="['/flags/',flagView.flagId]" class="button-action x-small">View</a>
</td>
</tr>
</tbody>
</table>
I am not getting any error message, but it is not working.
Please advice me what I need to do.
Thanks in advance.