• Resolved fredconv

    (@fredconv)


    Hi

    I would like to add a h2 on all cell of a specific column (not just the top header)
    but i don t understand how i can acheive this within wordpress or table press .

    for example in the page example, the “enginecode” column should be referenced as h2 titles.

    Is there any option / plugin / syntax i can use (i m not a developper sorry)

    thanks

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    You could simply type in the <h2> and </h2> around the desired text.

    Another idea, if you only want to do this to change the styling, is to use CSS code. For example, add this to the “Custom CSS” textarea on the “Plugin Options” screen of TablePress:

    .tablepress-id-5 .column-3 {
      font-weight: bold;
      font-size: 20px;
    }

    Regards,
    Tobias

    Thread Starter fredconv

    (@fredconv)

    hi

    thanks for the quick answer but
    since this is a big table, is there a way to do it with code i mean ??
    when i said i m not a dev, it s because i don t know how to use the callback and other render function in wordpress and where to put them ??

    so i would like if it s possible to have somehting like

    for all the 3rd cell in each row, wrap content into h2 tag :d

    soemthing equivalent to to that to put soemwhere in function.php or in the page

    could it be jquery but then it might not be parsed as h2 title by seo i suppose ..

    thanks for the help

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yes, you could do it with code. Please try adding this to the end of your theme’s “functions.php” file:

    add_filter( 'tablepress_cell_content', 'fredconv_tablepress_h2_column2', 10, 4 );
    function fredconv_tablepress_h2_column2( $cell_content, $table_id, $row_number, $column_number ) {
      if ( '5' === $table_id && $row_number > 1 && 3 === $column_number ) {
        $cell_content = "<h2>$cell_content</h2>";
      }
      return $cell_content;
    }

    Regards,
    Tobias

    Thread Starter fredconv

    (@fredconv)

    Yeah

    thanks a lot ??
    that works like a charm ^^

    Thnak you

    Thread Starter fredconv

    (@fredconv)

    Solved

    Plugin Author TobiasBg

    (@tobiasbg)

    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!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘wrapping specific td content into html tag’ is closed to new replies.