WordPress.org

Forums

TablePress
[resolved] Stop the generation of image classes (4 posts)

  1. kokoda
    Member
    Posted 10 months ago #

    Hi,

    How to stop the plugin from generating such a class when uploading images: "alignnone size-full wp-image-3860 imgborder". The reason is I found this class damages the css properties for images and is not editable in the plugin's css files.

    Regards,
    kokoda

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

  2. TobiasBg
    Member
    Plugin Author

    Posted 10 months ago #

    Hi,

    thanks for your post, and sorry for the trouble.

    Unfortunately, there's nothing really that I can do here. Those classes are not directly added by TablePress, but by the WordPress Media Library (that TablePress uses to let you choose images).
    A quick (but maybe time-consuming) way would be to immediately remove those CSS classes from the HTML that the Media Library inserts into a table cell.

    Another solution would maybe be to just override those CSS classes with the styling that you want, and to only do that in tables, by prepending the .tablepress class and using the !important keyword to increase the priority of that code, like

    .tablepress img {
      margin: 0 !important;
     ...
    }

    Regards,
    Tobias

  3. kokoda
    Member
    Posted 10 months ago #

    Hi.

    Thanks for your response. Could you please provide a CSS code for those problematic classes on how to disable them?

    Kind regards,
    kokoda

  4. TobiasBg
    Member
    Plugin Author

    Posted 10 months ago #

    Hi,

    just take my example from above. That will for example override the margin for all images in a TablePress table, regardless of which (unwanted) CSS classes it has.
    You will just need to extend that will all CSS properties that you want to change.

    Regards,
    Tobias

Reply

You must log in to post.

About this Plugin

  • TablePress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic