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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Sorry, adding IDs to table cells is not directly possible. You would need to use a plugin filter hook to add them.
    There are two alternatives however:
    1.) You could use selectors like

    jQuery( '.tablepress-id-123 .row-3 .column-2' )...

    to target a certain cell, or
    2.) you could add e.g. a <span id="my_id"></span> element to a cell and then use

    jQuery( '#my_id' ).parent()...

    Regards,
    Tobias

    Thread Starter lekiend

    (@lekiend)

    Thank you for your anwser.

    I’d like to suggest you an idea for future release.
    You could add an option to create automatic IDs in your table.
    This option could be: Generate cells IDs: Yes/No

    Results would be something like this
    <td id="row2-column2">cell content</td>
    <td id="row2-column3">cell content</td>

    This way we could use the javascript function getElementById

    Dimitri

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Dimitri,

    to be honest, I don’t really think that that’s something that is helpful for the majority of users. Such an option would only confuse people who don’t even know what an ID is. (I’m in favor of the WordPress philosophy of “Decisions, not Options.” here.)

    If my suggestions for how to select a cell are not what you want, I suggest to take a look at the tablepress_cell_tag_attributes plugin filter hook in the class-render.php file. With that you could add the ID to each cell as desired.

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to set IDs to specifics cells’ is closed to new replies.