Okay
  Public Ticket #1342242
Mutliple tables on one page
Closed

Comments

  • Dave started the conversation

    Hello,

    I was wondering if you can style multiple tables on one single page. With a maybe a css selector. The reason for this is I want to have at least 3, maybe 4 tables on 1 single page and I would like different styling.

    Looking forward to hearing from you,

    Dave

  • [deleted] replied

    Hi Dave,
    Thank you for the inquiry.

    Yes, something like that is possible with custom CSS code. There is "wpDataTables Custom CSS" field on wpDataTables settings page where you can add CSS to style differently your tables.

    You can try our sandbox site: Front-end & Back-end - you can find a fully functional version there to try out all plugin features.

  • Dave replied

    Hello Milos,

    Thanks for the quick reply, but isn't that for all tables as I saw in the sandbox? 
    I would like to style every table individually by #table-id  or something. 

    Kind regards,
    Dave

  • [deleted] replied

    Hi Dave,

    In one of the future updates we have plan to add custom CSS class per table, so you'll be able to add a class to the whole table and easily customize it.

    Now it is little more difficult but it is not impossible. When you add table to the page it will have id table_1, when you add the second table on the same page it will have id table_2. So you could use these id's as selectors for your CSS.

    Another problem is when you have more pages, so you'll have more tables with same id's so you should be more precise with your CSS selectors. For example you'll have to add page id before table id. So it should look something like this:

    .page-id-364 #table_1 {
        // Your CSS rules
    }