• Resolved jx2900

    (@jx2900)


    Hi,
    I love TablePress and can’t wait for the version 2.

    I read document and searched how to do it in this forum or FAQ and couldn’t find it.
    Is there any way to display the total number of rows of a specified table with table id or something using short code? I know that the total number of row is displayed below the table when “Display table info” is checked in JavaScript function. But I would like to obtain the information and display it way before the table is shown.

    The page is some technical reference page. I constantly add new terminologies daily basis so the number of row grows. I would like to display the total number of rows with larger font-size above the table.

    Is there any way?

    It is okay if there is any JavaScript code to get the total number of row, and I can just write the data into <span id=’num_table_row’> with JQuery.

    Best regards,
    Junji

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    For this, you can use the [table-info] Shortcode that comes with TablePress:

    [table-info id=123 field=number_rows /]
    

    Regards,
    Tobias

    Thread Starter jx2900

    (@jx2900)

    Thank you very much, Tobias,

    I re-checked the SHORTCODE page of Document to see if I missed the “number_rows” as field because I thought that I might have asked something it was documented since the solution was such an easy way. But I am relieved that it wasn’t listed there.

    Anyway, I love TablePress. Looking forward to version 2!

    Best regards,
    Junji

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for the reminder! I will indeed have to add that to documentation of that Shortcode!

    Best wishes,
    Tobias
    ?
    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Thread Starter jx2900

    (@jx2900)

    Hi Tobias,

    I found that field=column_numbers is also missing in the page. There might be other good feature missing.

    And your reply didn’t have double-quotations on field=number_rows but SHORTCODE page for table-info in your document shows that field value has to have double-quotations. I tried some and found no-double-quotation, double-quotation and single-quotation all worked except backward single quotation. Hope this is the way you intended and not a bug.
    *below all workded as well as other field such as name, last_modified, last_edited etc.
    number_rows <— your reply
    “number_rows” <— in the Document page
    ‘number_rows’ <— what I discovered

    I love TablePress. I have already rated 5 stars a way back. So I wanted to let you know what I found.

    Best regards,
    Junji

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    indeed, all of

    • no quotation marks (except if there are spaces in the parameter value)
    • regular " quotation marks
    • regular single ' quotation marks

    will work for Shortcode attributes (this is an intended WordPress feature and not TablePress-specific ?? ). Curly or backwards quotation marks will not work.

    Nowadays, I recommend to go without quotation marks where possible as it reduces the risk of copy/paste errors (where sometimes curly quotation marks are copied).

    Regards,
    Tobias

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Displaying number of rows with table-id using shortcode or JavaScript’ is closed to new replies.