• Resolved Michael

    (@taloscent)


    I have basically two types of tables. One with just 3 columns and one with 7. If I globally change the column widths it works for one group but not the other.

    Is it possible to assign tables to one group or another and then have different widths for those tables (groups) or will I need to define tables width per individual tables?

    https://wordpress.org/plugins/tablepress/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    By default, there are two main CSS selectors for tables in TablePress.
    First, there’s .tablepress-id-123 (which you are probably using now), and there’s .tablepress that can be used to style all TablePress tables in one go (without needing different statements). (This concept is explained in the section “CSS selectors” in the documentation at http://tablepress.org/documentation/ to some degree.)

    Additionally to that, you can “invent” your own additional CSS classes that you can give to one or multiple tables (via the “Extra CSS classes” textfield on a table’s “Edit” screen). That CSS class can then be used to apply CSS with a simple selector to several tables at once.

    For example, you could use the (invented) “Extra CSS classes” tablepress-3-columns-table and tablepress-7-columns-table and assing those to each of your table as they fit. The “Extra CSS class” basically is your “group”.
    Then, you can use “Custom CSS” like

    .tablepress-3-column-table .column-1,
    .tablepress-3-column-table .column-2,
    .tablepress-3-column-table .column-3 {
      width: 33%;
    }

    and similar for the tablepress-7-column-table class.

    Regards,
    Tobias

    Thread Starter Michael

    (@taloscent)

    Thanks!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Possible to group tables and apply custom css?’ is closed to new replies.