• Resolved ceekay0

    (@ceekay0)


    Hi Tobias,

    I’ve been a happy user with WP-Table reloaded and I am actually impressed on how smooth the transition was going for me.
    So first of all, thanks for all your hard work!

    One small feature request though: I would like to have the option to remove the plugin injected CSS completely.

    I like the idea of the custom CSS field very much, and think it’s a extremely useful feature for a lot of guys.

    I’m mostly developing responsive sites and therefore need to work inside media queries anyways. Besides that I try to limit the number of separately called stylesheets.

    From what I’ve seen it’s a small change to the frontend controller and of course another checkbox in the admin area.

    Maybe give it a thought.

    Thanks,

    Chris

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

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

    (@tobiasbg)

    Hi Chris,

    thanks for your question!

    You can turn off the inclusion of the default CSS with a plugin filter hook. Just add this to the “functions.php” of your theme:

    add_filter( 'tablepress_use_default_css', '__return_false' );

    I will not be adding an option for this in the “Plugin Options” of TablePress though, as this is not an option that an “average” user needs or should care about. I’m following the WordPress philosophy of “Decisions, not Options” here.

    Regards,
    Tobias

    That solution removes the default styles from all tables, not selected ones.
    The option to put “!important” on custom styles is there, but it would be nicer to have an option to dismiss the default styles on a table-by-table basis.

    This may be a CSS question:
    I add “customstyle” in the styles option and that style has:

    .customstyle { border:0; padding:0; margin:0 auto; }

    The resulting code (going from memory) looks something like this:

    <table class=”tablepress customstyle”>

    Perhaps the question should be “why doesn’t the border style defined in “customstyle” override the “tablepress” border?”

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    correct, that would remove the default CSS for all tables, but it has to be like that as the CSS needs to be loaded before we know whether there is a table on the page.
    You could however disable the loading on select pages — those where you know that there is now table. For information on that, please see http://wordpress.org/support/topic/removing-tablepress-cssscript-from-frontpage?replies=2

    Regarding your CSS code. What you describe is the “Extra CSS classes” feature, and you are using that in the correct way. However, your CSS

    .customstyle { border:0; padding:0; margin:0 auto; }

    is trying to override CSS code that TablePress is not using. TablePress does not set a border on the table actually, but on the cells of the rows. You would therefore need something like

    .customstyle tbody td {
      border-top: none;
      border-bottom: none;
    }

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Feature request: Remove default CSS’ is closed to new replies.