WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Different CSS classes for multiple tables using a single table ID (4 posts)

  1. odawg
    Member
    Posted 1 year ago #

    First of all your support is outstanding. Very impressive sir. Thank you for your dedication and one of the best plugins I've used.

    I'm building an American football league page for a client. I've created a single csv file for the user to add data such as standings, schedule, league info, owner list, etc. In the WP page, I've created multiple tables to display each category using your short code, ie [table id=7 hide_rows=all show_rows=1-10 /]. I was wondering if there is a way to add a specific class to the short code of a particular table so I can make it unique in design?

    For example, if I edit the CSS for

    .tablepress-id-7 .column-3 {
    color:#FFF;
    }

    All the tables on the page will have white text in column 3. I would like only one of the tables to have white text in column 3.

    Any help would be great sir an again, Thank you for TablePress! On my favorites list.

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    thanks for your post.

    The best solution for this would be to use "Extra CSS classes" for each of these tables. And as adding them via the "Extra CSS classes" field on the table's "Edit" screen wouldn't work (for the same reason why the regular class is not useful to you), you can add them via the Shortcode.
    Just change your Shortcode to

    [table id=7 hide_rows=all show_rows=1-10 extra_css_classes="tablepress-table-standings/]

    or

    [table id=7 hide_rows=all show_rows=11-20 extra_css_classes="tablepress-table-schedule/]

    The class names I used are just examples, you can choose anything you like there.
    These are then added to the table that results from that Shortcode.
    You can then use the new class in the CSS, like

    .tablepress-table-standings .column-3 {
      color:#FFF;
    }

    Regards,
    Tobias

  3. odawg
    Member
    Posted 1 year ago #

    Very good sir. Thank you so much!

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    awesome! Great to hear that this worked so easily :-)

    Best wishes,
    Tobias

    P.S.: In case you haven't, don't forget to rate the plugin here in the plugin directory. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic