• Resolved billznik

    (@billznik)


    Is it possible to, instead of have to enable horizontal scrolling for mobile devices, to enable it once for all tables, globally? Perhaps with CSS?

    • This topic was modified 6 years ago by billznik.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    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

    Thread Starter billznik

    (@billznik)

    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?

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    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

    Thread Starter billznik

    (@billznik)

    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?

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    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

    Thread Starter billznik

    (@billznik)

    Works great, thanks! Will rate 5 stars.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    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

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

The topic ‘Enable horizontal scrolling globally?’ is closed to new replies.