• i really like the way the plugin works. but i am forced to use the plugin css. but i have my own custom css delivered with bootstrap. so there is no need for additional css.
    it would also be good to have more examples for hooks. bootstrap has responsive classes for tables. they work like this:

    <div class="table-responsive">
    <table class="table">
    …
    </table>
    </div>

    so how to wrap the div around your tables?!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your rating, I really appreciate it!

    About that Bootstrap integration:
    The best approach here would be to simply manually add the <div> container around the Shortcode, i.e. to write

    <div class="table-responsive">
    [table id=123 /]
    </div>

    in your post/page.

    To also add the “table” CSS class, you can simply add that into the “Extra CSS classes” field on the “Edit” screen of the table, or also add it to the Shortcode, like

    [table id=123 extra_css_classes="table" /]

    Regards,
    Tobias

    Thread Starter nicmare

    (@nicmare)

    thank you for your answer. i better modfied class-render.php to wrap the table into a div. i dont want to use html code in every post…

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    modifying class-render.php is not a good idea, as you would lose those modifications after each plugin update.
    Instead, you should then use the tablepress_table_output filter hook and add the <div> there.

    Regards,
    Tobias

    Thread Starter nicmare

    (@nicmare)

    yea, this was my very first question as i was asking for more hooks to wrap the table in a custom div. do you have an example code snippet please?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    this (in your theme’s “functions.php”) should do it:

    add_filter( 'tablepress_table_output', 'tablepress_add_div_wrapper', 10, 3 );
    function tablepress_add_div_wrapper( $output, $table, $options ) {
      $output = '<div class="table-responsive">' . $output . '</div>';
      return $output;
    }

    Regards,
    Tobias

    Thread Starter nicmare

    (@nicmare)

    perfect – thank you very much.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘very good plugin but i miss bootstrap support’ is closed to new replies.