Hi,
thanks! It appears that this table does not have the “Enable visitor features” checkbox checked on its “Edit” screen, correct?
That would be required for the horizontal scrolling to work. Now, this can also be done in the same way with that piece of code, but when doing that, it will likely directly enable sorting, filtering, and pagination for this table. These can then likewise be turned off again, but this would again affect all tables on the site. So, if you want all tables on the site to only have horizontal scrolling, but not the other features, this should do it:
add_filter( 'tablepress_table_render_options', 'sunsetbld_tablepress_responsive_scroll', 10, 2 );
function sunsetbld_tablepress_responsive_scroll( $render_options, $table ) {
$render_options['use_datatables'] = true;
$render_options['datatables_sort'] = false;
$render_options['datatables_filter'] = false;
$render_options['datatables_paginate'] = false;
$render_options['datatables_info'] = false;
$render_options['datatables_scrollx'] = true;
return $render_options;
}
Regards,
Tobias