WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Retaining CSS when copying a table (6 posts)

  1. AMEEKER
    Member
    Posted 1 year ago #

    Is there a way to retain the Custom CSS of a table when copying it?

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    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

  3. AMEEKER
    Member
    Posted 1 year ago #

    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.

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    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

  5. AMEEKER
    Member
    Posted 1 year ago #

    Makes perfect sense. Thanks!

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.