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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    No, that code is totally correct and should work fine.
    What exactly have you tried and where did you add it?

    Regards,
    Tobias

    Thread Starter suprpp

    (@suprpp)

    Hi,

    thank you for your prompt reply!

    I’ve tried adding this to my functions.php

    add_filter( 'tablepress_table_output', 'tp_add_wrapper', 10, 3 );
    function tp_add_wrapper( $output, $table, $render_options ) {
      $output = "<div class=\"tablepress-wrapper\">\n{$output}\n</div>";
      return $output;
    }

    Then I refresh the page but the wrapper div doesn’t appear around the table.

    The table is inserted into my contact page using a shortcode like this:

    [table id=1 /]

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    just to be sure, that’s the “functions.php” of your active theme? Does it work after saving the table again (to clear the TablePress cache)? Are you maybe using any other caching plugins?

    Regards,
    Tobias

    Thread Starter suprpp

    (@suprpp)

    Tobias,

    that was it – I had to save the table again.
    Thanks again for your awesome support!

    Kind regards,
    suprpp

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

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

    Best wishes,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Wrap a div around a table’ is closed to new replies.