0

I'm developing a mobile application using the lateat ionic. I've installed ngx-datatable with npm to display some data. The table is working but I'm not able to apply the style. Following the documentation I added this to my page scss:

page-datapage{

  @import '~@swimlane/ngx-datatable/release/index.css';
  @import '/node_modules/@swimlane/ngx-datatable/release/themes/material.css';
  @import '~@swimlane/ngx-datatable/release/assets/icons.css';

}

and this in my page template:

  <ngx-datatable class="material"
    [rows]="rows"
    [columns]="columns">
  </ngx-datatable>

The table appear and it is working (even the sorting is working) but the table is is not styled and no icon appear.

AleCat83
  • 1,443
  • 3
  • 22
  • 41

1 Answers1

0

You need to copy index.css, material.css and icon.css to src/assets folder.

After copying, rename the files to _index.scss, _material.scss and _icon.scss

In your app.scss import the files as follows:

@import '../assets/index';
@import '../assets/material';
@import '../assets/icons';

Font: https://github.com/swimlane/ngx-datatable/issues/1249#issuecomment-359629984

Diogo Rodrigues
  • 1,312
  • 15
  • 15