To use Bootstrap 4 with DataTablejs use npm to install Bootstrap 4 package.
npm install --save datatables.net-bs4
Then, Update ".angular-cli.json" files Styles and scripts properties as below.
{
........
"apps": [
{
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
//for bootstrap4
"../node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js",
"../node_modules/datatables.net/js/jquery.dataTables.js",
//for bootstrap4
"../node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js"
]
...
}
],
.....
}
after above changes, we can use bootstrap4 classes to shows table like a bootstrap4 table for example
<table id='table' datatable [dtOptions]="dtOptions" class="table table-striped table-bordered" cellspacing="0" width="100%">
</table>