Hi,
thanks for your post, and sorry for the trouble.
How does the full table look like? Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!
Regards,
Tobias
To be honest, we plan a very simple table, right now is something like:
https://p50.edu.pl/jadlospis/
Right now, I installed Your extension that allows collapsing, and it displays in column as on the main page for test purpose.
-
This reply was modified 6 years ago by
klaszewski.
Hi,
ok, thanks! So you would need to only show one specific column per day.
You could maybe use custom code like this, to create wrapping Shortcode that will then only show the first column and the current day’s column:
add_shortcode( 'table_today', 'klaszewski_tablepress_today_shortcode' )
function klaszewski_tablepress_today_shortcode() {
$weekday = date( 'N' );
if ( $weekday > 5 ) {
// Don't show anything on the weekend.
return '';
}
$column = $weekday + 1;
$atts = array(
'id' => '1',
'hide_columns' => 'all',
'show_columns' => "1,{$column}",
);
return tablepress_get_table( $atts );
}
You could put this into your theme’s “functions.php” file and then put the Shortcode [table_today /] into your sidebar.
Regards,
Tobias
Is there any way to pair it with collapsing without much coding?
Hi,
I’m not sure how that should look like, but it should be not problem to use the TablePress Responsive Tables Extension with this. Just add
'responsive' => 'collapse',
after the line
'show_columns' => "1,{$column}",
Regards,
Tobias
Thanks! This works great!
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!