Background Color of Rows

Background Color of Rows

TheCastOutTheCastOut Posts: 2Questions: 1Answers: 0

https://syrniaguide.com/Bestiary

Okay, so I am a newbie with this ordeal and coding is something I am brand new at. My default theme css blends well with black backgrounds and it typically is that for tables.

When I go to use DataTables the colors (see the link above) switch to this light blue and white ... with white text. It makes it impossible to see the data on the tables that I use Datatables for.

I need some guidance on what line to code to change to change or override this gawdy looking table.

I'm using Drupal if that makes any difference, so the DataTables is in its own libraries folder.

I feel it is in one of these css files that I need to alter something?

I appreciate any assistance or guidance you give me. I just want the tables to be functional and easy to see :smile:

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    You can style with CSS - see this example here. If you look at the CSS tab, you'll see how rows can be styled anyway you choose,

    Colin

  • TheCastOutTheCastOut Posts: 2Questions: 1Answers: 0

    Hi Colin,

    So which file on my database would I edit to change the background color of rows? and where can I find it?

  • kthorngrenkthorngren Posts: 21,184Questions: 26Answers: 4,925

    Typically custom CSS is added in the style section of the page. Add the CSS in the empty style section you have now, for example:

    <style>
    table.dataTable.display tbody tr.odd > .sorting_1 {
        background-color: red;
    }
    
    table.dataTable.display tbody tr.odd {
        background-color: red;
    }
    
    table.dataTable.display tbody tr.even > .sorting_1 {
        background-color: green;
    }
    
    table.dataTable.display tbody tr.even {
        background-color: green;
    }
    </style>
    

    Kevin

Sign In or Register to comment.