Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ngx-datatable - Bootstrap theme - Column headers

I'm trying to implement ngx-datatable with the implementation of the theming for Bootstrap.

I'm adding the Bootstrap CSS from both Bootstrap 4 and from ngx-datatable on the app styles:

"styles": [
          "node_modules/bootstrap/dist/css/bootstrap.css",
          "node_modules/@swimlane/ngx-datatable/release/themes/bootstrap.css",
          "src/styles.css"
        ],

And then implementing the table on my page component:

<ngx-datatable class="bootstrap"
[rows]="tablePage.results"
[columns]="columns"
[columnMode]="'force'"
[rowHeight]="'auto'"
[headerHeight]="50"
[footerHeight]="50"
[externalPaging]="true"
[loadingIndicator]="loading"
[count]="tablePage.pager.count"
[offset]="tablePage.pager.offset"
[limit]="tablePage.pager.limit"
[reorderable]="true"
(page)='setPage($event)'>

Also, the modules are all imported into the app module:

imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
NgbModule,
FontAwesomeModule,
NgxDatatableModule
],

The problem comes with the fact that no column header icons are shown. None of the sorting direction icons are shown and I don't know what else to add since everything seems setup just like in the demo site.

like image 403
CesarD Avatar asked Feb 27 '26 23:02

CesarD


1 Answers

don't forget to include node_modules/swimlane/ngx-datatable/release/assets/icons.css

or for sass @import '~@swimlane/ngx-datatable/release/assets/icons.css';

like image 198
Jayme Avatar answered Mar 02 '26 15:03

Jayme



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!