• Resolved thedaidontstop

    (@thedaidontstop)


    Hello, I’m considering buying the premium version of the tablepress plugin but before doing that I hope that perhaps someone in support can answer my undocumented question (or at least I think it is).

    Is it possible to “automatically make all tables scrollable?” I’m working with a number of tables and having to go in and modify them all one by one would not be the most effective use of my time.

    Cheers!

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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    Yes, this is possible, by adding a small piece of code to your theme’s “functions.php” file. This will basically turn on the Shortcode parameter for all tables automatically and behind the scenes:

    add_filter( 'tablepress_table_render_options', 'tp_turn_on_scroll-responsiveness', 10, 2 );
    function responsiveness( $render_options, $table ) {
      $render_options['responsive'] = 'scroll';
      return $render_options;
    }

    Regards,
    Tobias

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    I just realized that there are some typos in my code. This should be the correct version:

    add_filter( 'tablepress_table_render_options', 'tp_turn_on_scroll_responsiveness', 10, 2 );
    function tp_turn_on_scroll_responsiveness( $render_options, $table ) {
      $render_options['responsive'] = 'scroll';
      return $render_options;
    }

    Regards,
    Tobias

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

The topic ‘Automatically make all tables scrollable.’ is closed to new replies.