WordPress.org

Support

Support » Plugins and Hacks » TablePress » [Resolved] Retaining CSS when copying a table

[Resolved] Retaining CSS when copying a table

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

    @tobiasbg

    Hi,

    thanks for your question.

    Retain the “Custom CSS”? I’m not sure I understand. No “Custom CSS” is deleted or modified, when a table is copied.

    You will need to go to the “Custom CSS” textarea in the “Plugin Options” (which holds the CSS for all tables at once), find the relevant CSS for the table that was copied (by picking everything that includes that table’s ID), copy that, paste it in again and modify the ID to the new ID.

    Regards,
    Tobias

    Hi Tobias,

    Thanks for the quick reply. I’m using TablePress on a client’s site who will need to replicate a table week after week, changing only the contents. That table has some custom CSS. I’m looking for the SIMPLEST way for him to be able to reuse the styling from that first table each week. I knew of the method you mentioned, but didn’t know if there was any other way to…um… I don’t know? make any tables copied from that original table inherit it’s styling, even if we have to do it through the theme.

    Plugin Author TobiasBg

    @tobiasbg

    Hi,

    thanks for the explanation! Yes, I can think of a way! We could use an “Extra CSS class” for this.
    For example, you can use the CSS class “tablepress-weekly-update”, or whatever you want to call it.
    Then, just change the CSS for the table that is going to be copied accordingly, i.e. replace the selectors .tablepress-id-123 (or whatever the ID of the “master table” is) with .tablepress-weekly-update.
    The clue is now to add “tablepress-weekly-update” into the “Extra CSS classes” textfield on the “Edit” screen of the “master table”. As all copies of that “master table” will have the extra CSS class (“tablepress-weekly-update”) as well, the CSS that uses that class will automatically be applied.

    I hope that explanation is not too confusing… 🙂

    Regards,
    Tobias

    Makes perfect sense. Thanks!

    Plugin Author TobiasBg

    @tobiasbg

    Hi,

    great! 🙂 I hope that this approach works for you and your client!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Retaining CSS when copying a table’ is closed to new replies.
Skip to toolbar