Hi,
thanks for your post, and sorry for the trouble.
For adding the responsive mode to all tables at once, please see https://ww.wp.xz.cn/support/topic/set-responsive-mode-by-defualt/
Regards,
Tobias
Thanks, do I need the responsive add on for this method to work? Also what would the code look like for the scroll mode instead of the stack mode as detailed in that post?
Hi,
yes, you would need to install and activate the TablePress Responsive Tables Extension for this.
To then enable the scroll mode automatically, the corresponding code would be
add_filter( 'tablepress_shortcode_table_default_shortcode_atts', 'billznik_tablepress_responsive_stack_default', 11 );
function billznik_tablepress_responsive_stack_default( $default_atts ) {
$default_atts['responsive'] = 'scroll';
return $default_atts;
}
Regards,
Tobias
Thanks. I noticed you used my user name “billznik” inside the code, is that necessary? If my user name is different inside WP should I use that instead?
Hi,
no, that name is not necessary. It’s basically just there to be sure that we don’t run into PHP function names being used twice (which is not allowed). You can change/remove it if desired, but don’t have to.
Regards,
Tobias
Works great, thanks! Will rate 5 stars.
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
And thanks for wanting to rate, I really appreciate it!
Best wishes,
Tobias