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">
...
    </div>
</div>

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?

Answers

  • 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: 61,438Questions: 1Answers: 10,052 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.

    Allan

This discussion has been closed.