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?”
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