Bootstrap 4 and no-gutters

Bootstrap 4 and no-gutters

camainccamainc Posts: 19Questions: 3Answers: 0

I've wrapped my datatable in a wrapper like so:

<div class="row no-gutters">
    <div class="col-md-12">

but the generated table doesn't inherit the no-gutters class, so it expands out to the right and left (because of the negative margins on the row class).

How can I ensure that the datatable uses the .no-gutters class when it generates it's row wrappers?


  • camainccamainc Posts: 19Questions: 3Answers: 0

    I solved this with a workaround for now, but would really not have to do this all the time.

    I changed my wrapper to be:

    <div style="margin-left:15px; margin-right:15px;"> ... </div>

    I can create a class for this, of course, but I would still have to add it around every datatable instance. I guess that's not too bad.

  • allanallan Posts: 50,571Questions: 1Answers: 7,530 Site admin

    You would currently need to modify the dom property to add the no-gutters class to the row divs. Its a little bit of a pain as the BS4 string for dom is really long, but it is possible.

    I'm working on making this easier for DT2.


Sign In or Register to comment.