Bootstrap styled table and display class on the table element

Bootstrap styled table and display class on the table element

marcelgroenewegmarcelgroeneweg Posts: 12Questions: 4Answers: 0

Hi,

It seems I need to put in the individual classes that make up the display class for a bootstrap styled table. I checked some of the bootstrap examples, also for the extensions, and they also use specific classes rather than the general display class.

Also, the bootstrap examples use classes like table-hover, where the default classes manual page states hover, without the table- prefix.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,880Questions: 1Answers: 10,139 Site admin

    I'm afraid I'm not entirely sure what your question is. If you need to add classes to the table you can do so with the class attribute in the HTML or use jQuery's $().addClass() before initialising the table.

    Keep in mind that the majority of the examples on this site don't use Bootstrap and therefore don't use Bootstrap specific classes (they use the DataTables stylesheet).

    Allan

  • marcelgroenewegmarcelgroeneweg Posts: 12Questions: 4Answers: 0

    I started with the default style. Now I want to implement Bootstrap styling so I replaced the CSS with the bootstrap ones and loaded the additional JS. My table had class 'display' on it, which works fine with the default styling. With bootstrap styling, the class does not seem to work correctly. I checked the bootstrap styling examples and the bootstrap examples of buttons colvis and scroller. These do not use the display class at the table. Or is the display class simply not available when using bootstrap?

  • allanallan Posts: 61,880Questions: 1Answers: 10,139 Site admin
    Answer ✓

    With bootstrap styling, the class does not seem to work correctly

    Bootstrap provides its own table styling classes. You would use them if you are using Bootstrap, not the DataTables classes.

    Allan

  • marcelgroenewegmarcelgroeneweg Posts: 12Questions: 4Answers: 0

    OK now I get it. Thanks!

This discussion has been closed.