• Resolved theangrychicken

    (@theangrychicken)


    Hi
    I need to create multiple tables. Is there a quick way to reference all tables ie table 1 to 50 without having new code for each table ? An all encompassing simple easy code instead of:

    .tablepress-id-2 tbody td {
    color: #000000;
    }

    .tablepress thead th,
    .tablepress tfoot th {
    background-color: #ff6600;
    }

    .tablepress-id-2 {
    width: auto;
    margin: 0 auto 1em;
    }

    .tablepress-id-2 .column-2 {
    text-align: center;
    }

    .tablepress-id-3 tbody td {
    color: #000000;
    }

    .tablepress thead th,
    .tablepress tfoot th {
    background-color: #ff6600;
    }

    .tablepress-id-3 {
    width: auto;
    margin: 0 auto 1em;
    }

    .tablepress-id-3 .column-2 {
    text-align: center;
    }

    .tablepress-id-4 tbody td {
    color: #000000;
    }

    .tablepress thead th,
    .tablepress tfoot th {
    background-color: #ff6600;
    }

    .tablepress-id-4 {
    width: auto;
    margin: 0 auto 1em;
    }

    .tablepress-id-4 .column-2 {
    text-align: center;
    }

    etc etc
    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Directly targeting a group of tables in a short CSS command is not possible, unfortunately. Your best chance here is to use the general .tablepress selector (as you are already doing), to target ALL TablePress tables on the site.

    Another idea would be to group tables yourself, using so-called “Extra CSS classes”. With this, you would add a table to a desired group on its “Edit” screen and could then use much smaller CSS code. For an example of that, please see https://wordpress.org/support/topic/table-groups/

    Regards,
    Tobias

Viewing 1 replies (of 1 total)

The topic ‘Multiple Table Code’ is closed to new replies.