WordPress.org

Support

Support » Plugins and Hacks » TablePress » [Resolved] Disable standard TablePress CSS

[Resolved] Disable standard TablePress CSS

  • jaap

    @webjaap

    For those of you out here that don’t like a standard CSS applied to your tables and rather use completely your own instead of first having to override the standard TablePress CSS, add this to your functions.php:

    add_filter('tablepress_use_default_css', false);

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

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

    @tobiasbg

    Hi,

    thanks for your post. Yes, disabling the Default CSS is possible via that filter. However, your code contains a small error. The correct usage is

    add_filter( 'tablepress_use_default_css', '__return_false' );

    Now, while this works, I really don’t recommend doing this! The reason is that you will lose the styling for the advanced features, like the sorting arrows, but also things like the alternating row colors.
    It is much better to use the default CSS and just add some “Custom CSS” (for examples, see the plugin FAQ at http://tablepress.org/faq/ ) to overwrite the default CSS. This ensures that basic functionality will still work.

    Regards,
    Tobias

    Hi TobiasBg
    this is a massive performance overkill
    if I use all css files from plugins,
    so I try to delete plugin css too and use my own. And I know how to style “even and odd” – and I can style arrows too 😉
    so thanks for this code “correction”.

    Plugin Author TobiasBg

    @tobiasbg

    Hi,

    I don’t really see why this would be a “massive” performance overkill. There would be a few CSS declarations that would be loaded although they are not used, but that applies to so much code in the theme that this is not really a valid argument, in my opinion.
    Of course, if you know how to get back the features like alternating row colors and the sorting arrows, I won’t stop you from using that hook to remove the default styling 🙂 Just be aware that you might not benefit from changes/fixes/new features in the CSS immediately.

    Regards,
    Tobias

    jaap

    @webjaap

    Thanks for the code-correction. I don’t think it’s performance overkill, but this particular website runs a lot of plugins so I try to keeps things minimised and organised 🙂 But the average user indeed doensn’t need this.

    Plugin Author TobiasBg

    @tobiasbg

    Hi,

    no problem! Yes, in your and Monika’s use cases, this if of course worthwhile to do then.

    Best wishes,
    Tobias

    Ah, I was about to post and ask for this option to be added, but I should’ve known that you’ve already thought of it. Thanks.

    In my case, I’ve got a designer-made CSS styles for the tables, and the default styles are messing with them – easier just to disable all default styles instead of hunting down the offending bits and covering them.

    We use few of the advanced features anyway, just static tables (even for those, your plugin is a must-have – we have literally hundreds of tables on our sites and managing them without your plugin would be a pain).

    Plugin Author TobiasBg

    @tobiasbg

    Hi,

    thanks for that feedback! 🙂 Good to hear that this option will be helpful for you!

    Best wishes,
    Tobias

    Thank You for the info!

    Generally: Disabling the plugin-css is very important to reduce the number of http-requests. This is a important “to-do”, if you pimp a website for speed-optimization…

    For this reason it is better to put all the plugin-css into the main css-file.

    Feature request to Tobias 🙂
    Maybe you could give us in the future a general option to disable the css in Your (marvelous) plugin?

    Greetings from Berlin
    Heiko

    Plugin Author TobiasBg

    @tobiasbg

    Hi,

    thanks for your question, and sorry for the late answer. As I was on vacation, I didn’t have a chance to reply earlier.

    Such an option already exists, namely a plugin filter hook, as described in my first reply in this thread 🙂
    I will not add a checkbox for this though, as that would not be useful and would just confuse regular users.

    And I agree that reducing HTTP requests is a good thing, and as TablePress uses the WordPress script/style enqueuing functionality, this can easily be used by a minification plugin that combines all CSS file into one.

    Regards,
    Tobias

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Disable standard TablePress CSS’ is closed to new replies.
Skip to toolbar