WordPress.org

Forums

TablePress
[resolved] Force Table Name to h3 (6 posts)

  1. nick_the_greek
    Member
    Posted 2 years ago #

    Hi,
    I have read about changing the font of a table name by using

    .tablepress-table-name {
      font-size: 16px;
    }

    But I need to force the table name to use the h3 heading. Is this possible?

    http://wordpress.org/extend/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    thanks for your post.

    Yes, changing this from an <h2> to an <h3> is possible, and only requires some small PHP code.
    Please try adding this to your theme's "functions.php".

    add_filter( 'tablepress_print_name_html_tag', 'tablepress_change_table_name_h2_to_h3', 10, 2 );
    function tablepress_change_table_name_h2_to_h3( $tag, $table_id ) {
      $tag = 'h3';
      return $tag;
    }

    Regards,
    Tobias

  3. nick_the_greek
    Member
    Posted 2 years ago #

    Worked great thanks so much!

  4. TobiasBg
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    sure, no problem! :-) Great to hear that this did it!

    Best wishes,
    Tobias

    P.S.: In case you haven't, please rate the plugin here in the plugin directory. Thanks!

  5. marketzeitgeist
    Member
    Posted 1 year ago #

    Hi Tobias,

    I would like to do the same (change table-name to <h3>) but when I added the PHP code as you suggested...it didn't work. I tried several times to ensure that it was not a typo mistake. Could it be a WordPress issue? I am currently using WordPress 3.5.1.

    Any suggestions/advice would be earnestly appreciated.

    Thanks in advance,

    Matt Peters

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Matt,

    looks like you already found the solution in http://wordpress.org/support/topic/table-name-style-change Great :-)

    Best wishes,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic