Using two different Styles

Using two different Styles

choggerchogger Posts: 15Questions: 4Answers: 0

Hallo Datatables Fans ;)

I'm running into a problem I can't understand and solve on my own...

I have a stylesheet included in my website where I have two classes for two different tables...

.datatables td, th
{
padding: 0px;
}

.datatables-padding td, th
{
padding-left: 20px;
}

My problem is (and I think it is a datatables and not a styling thing) that each time I use a class='' to style the table the datatables-padding gets used. How can I change this behaviour?

Thank you in advance

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,783Questions: 1Answers: 10,511 Site admin
    Answer ✓

    Your CSS is incomplete - you really want:

    .datatables-padding td,
    .datatables-padding th {
      ...
    }
    

    Otherwise your selector is always selecting all th elements, regardless of the class name.

    Allan

  • choggerchogger Posts: 15Questions: 4Answers: 0

    oh my god...
    Such a terrible mistake, sry for the question :/
    Thank you :)

This discussion has been closed.