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

    (@tobiasbg)

    Hi Matthias,

    thanks for your question!

    Now, TablePress does have an option to show the table name above the table (there’s a checkbox for that on the table’s “Edit” screen), but by default, this does not use the HTML <caption> tag, but an <h2> heading (with the CSS class tablepress-table-name.

    Using the <caption> tag is possible by using the tablepress_print_caption_text plugin filter hook. If you prefer that over an <h2>, I’ll try to get some example code ready later today or tomorrow.

    Regards,
    Tobias

    ive got my own code that has an caption but this is with an image code below:

    <img title="Caption is here so replace text" alt="" src="image url here" width="30" height="30" /></a></td> you cna change the width/height

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Paul,

    thanks for helping out!
    Yes, that’s a caption for an image, but Matthias wants table captions which is a slightly different concept.

    Regards,
    Tobias

    Thread Starter ma77es

    (@ma77es)

    Ok, I’m waiting for your tablepress_print_caption_text example 😉

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    good news: I’ve developed a small TablePress Extension that prints the name of a table in an HTML <caption> element. You can then style that via CSS, just as one your current site.

    To use that, you’ll just have to install and activate http://tablepress.org/download/extension/tablepress-table-caption-html-tag.zip as a regular WordPress plugin.
    But before that, you’ll need to update to the TablePress development version from http://tablepress.org/download/tablepress-dev.zip . Just download that and replace the “tablepress” plugin folder on your server with that from the ZIP archive. The dev version fixes a small bug in the caption handling that I discovered when developing the Extension.

    Regards,
    Tobias

    Thread Starter ma77es

    (@ma77es)

    Hi Tobias,

    thanks a lot. You do a very good job 🙂
    But:
    1. Is it possible that the tablepress table caption is developed directly into the tablepress plugin without an extra plugin?
    2. Where can I deactivate the “edit” button in the table that is shown when I’m logged in?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for the kind words! 🙂

    1. Can you explain why you don’t like the approach with the TablePress Extension here? Or what would adding this to TablePress directly bring as a benefit for you?

    2. That’s possible with another small Extension: http://tablepress.org/extensions/remove-edit-link/

    Regards,
    Tobias

    Thread Starter ma77es

    (@ma77es)

    ok, that’s very nice so far 🙂 thanks a lot!

    to point 1: I think you habe a better overview when you put the “hacks” directly into the plugin. So you can put it to the plugin options. perhaps there are a few users they need this extensions too.

    i.e. now i’ve got 22 active plugins, 2 are extra out of tablepress-extensions …

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    great to hear that this helps!

    For 1.: My stand on this is the complete opposite 🙂 Plugins and their options (the same goes for themes) should be as easy to use as possible, with as few options as possible. Those just confuse new users (I’ve experienced this in WP-Table Reloaded, myself.)
    This paradigm of “Decisions, not Options” is also followed by WordPress, and explained nicely at http://wordpress.org/about/philosophy/
    And there’s no real point of worrying about the number of plugins. That’s not problematic at all.

    Best wishes,
    Tobias

    Hi,

    If I want to use the “tablepress-table-caption-html-tag” plugin (as described above) and am running the current Tablepress 0.9 RC do I still need to switch to the development release first?

    BTW, are you planning on adding further support for the <caption>, <summary> and <details> HTML5 table tags as well? (i.e. in the Tablepress options UI?). I was planning on enhancing the accessibility of my tables as described here: http://www.developerfusion.com/article/136530/making-tables-more-accessible-with-html5/

    cheers,

    Arno

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Arno,

    thanks for your post!
    Yes, you will still need to switch to the development version, as the change that is necessary for this Extension is not part of 0.9-RC.

    At the moment, I don’t have plans to add support for these new HTML tags into the UI (which is already too crowded). But with the Extension, and a small modification in it, you can easily achieve this yourself, and for example automatically put the table description into the summary field.

    Regards,
    Tobias

    Super – and thank you for the very quick response.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    sure, no problem! You are very welcome!

    Best wishes,
    Tobias

    I have the same “caption” issue, in that the default size <h2> is too big for the look of my page. I agree with Ma77es that a size for the caption/title would be a great option to have. I think this is such a basic “decision” that someone using WordPress is making, that it should be a standard “option”. After all, font size is a standard “option” in the themes for entering any text on a page.

    By putting this caption/title size option in the plugin, the user is provided instant flexibility. Personally, the more I have to “customize” a plugin, the less likely I am to use it. I prefer a plugin that is built with user-logic.

    That said, I found an easy fix for caption/title size. I use the Description text box, enter the caption/title between the begin/end codes for the size header I want. For example on this page:

    http://www.bedetrial.org/rector-search/

    I put <h3>Rector Discernment Committee:</h3> in the Description text box, then selected Print Table Description and “above”. I got just what I wanted.

    TablePress is a great plugin. I also use TablePress to add “columns” to just a portion of a page. This gives me a lot of flexibility and creativity.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post and sorry for the trouble!

    Adding an option for this is not really an option, as it would make the user interface much more complex and cluttered. And most users have no idea what the difference is between <h2> and <h3>.
    Instead, I suggest that you use a plugin filter hook, to globally change the used HTML tag. Please try adding this to your theme’s “functions.php”:

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

    (As a sidenote on your last paragraph: Using tables as “columns” for a portion of the page is not really the best way in modern webdesign. You should consider something like http://wordpress.org/plugins/grid-columns/ for this.)

    Regards,
    Tobias

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Table Caption’ is closed to new replies.