At the moment I wrap table inside .table-responsive
However, the size of column make the grid more than container, which add scroll on body.
Any idea how to fix this?
I saw an option in datatables for enable responsive, but can't find how to do that via PHP service class.
You need to have the responsive js plugins added. See https://datatables.net/reference/option/responsive for ref.
On server-side, just set the parameters 'responsive' => true.
Thanks for tips. Where to set that parameters? Considering that I am using Service class.
On the html function:
```php
->parameters([
'responsive' => true,
...
])
Thanks I got it.
I don't see too much change adding this option.
I added also autoWidth as false, this:
->parameters([
'responsive' => true,
'autoWidth' => false
])
Now the width is 100% always, but resizing window is not fully responsive.
I think that is required to add also the responsive css of datatable, as this example show:
https://www.datatables.net/extensions/rowreorder/examples/initialisation/responsive.html
I will try
Work fine adding css and js of responsive datatables:
<link href="//cdn.datatables.net/responsive/2.2.3/css/responsive.dataTables.min.css" rel="stylesheet">
<script src="//cdn.datatables.net/responsive/2.2.3/js/dataTables.responsive.min.js"></script>
Most helpful comment
Thanks I got it.
I don't see too much change adding this option.
I added also autoWidth as false, this:
Now the width is 100% always, but resizing window is not fully responsive.
I think that is required to add also the responsive css of datatable, as this example show:
https://www.datatables.net/extensions/rowreorder/examples/initialisation/responsive.html
I will try