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.

    Inserting chunks of HTML code into a table cell is tricky. The problem comes from the line breaks in the code. These are automatically converted to HTML <br /> tags, but when these then are part of the JavaScript code, the JS just breaks.
    To fix this, you’d have to write the entire HTML and JS code in one line of text, i.e. without manual line breaks (but only those that are added automatically by the word wrapping of the browser, due to the width of the the input field).
    Another solution would be to extend the Shortcode of the table to

    [table id=1 convert_line_breaks=false /]

    This will turn off the automatic replacement of line breaks, so that the HTML/JS code should work. You might then just have to fix those cells in your table that use line breaks on purpose, by inserting a <br /> manually.

    Regards,
    Tobias

    Thread Starter joehark

    (@joehark)

    Thank you for the fantastically rapid response!

    I see your point and will try those suggestions.

    BTW – I note that the plugin is adding a search to the page, directly above the table. It is not needed in this installation because it is only 4 rows and columns. Was there a setting I missed that installed it?

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Always glad when I can help!

    You can turn that search off (together with the features like sorting, etc.) in the “Features of the DataTables JS library” section on the “Edit” screen of the table. Either uncheck the unwanted features, or turn off all of them by unchecking “Use DataTables”.

    Regards,
    Tobias

    Thread Starter joehark

    (@joehark)

    I am impressed with the visual interface you provide. I wish I had known of this plugin a long time ago.

    I am totally broke today but in a few days I will be happy to donate.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    great to hear that you like it! ?? And thanks for wanting to donate, I really appreciate it!

    Best wishes,
    Tobias

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘adding a script to a cell’ is closed to new replies.