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

    (@tobiasbg)

    Hi Elodie,

    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 JS 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=123 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 elodieg14

    (@elodieg14)

    Thank you Tobias for your quick response. It’s working either with [table id=123 convert_line_breaks=false /] or “write the entire HTML and JS code in one line of text” but it seems not possible to have 2 or 3 html code in the same table.

    If I had different html code in different cells, only the firt availability calendar appears.

    Have you ever experience that?

    If it’s not possible to get this type of html code in the same table, how can I put side by side 2 tables?

    Thank you very much for your help.

    Best,

    Elodie

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Elodie,

    good to hear that it works for one piece of code with that extra Shortcode parameter.

    I don’t really know why it’s not working with two pieces of code though. This is most likely not caused by TablePress, but by that JavaScript.
    For example, you’ll probably need the

    <script type="text/javascript" src="https://gadget.open-system.fr/widgets-libs/rel/noyau-1.0.min.js"></script>
    <script type="text/javascript" src="https://gadget.open-system.fr/widgets-libs/rel/osplanning/osplanning-pack-1.0.min.js"></script>

    part just for the very first piece of this code on the page.

    Regards,
    Tobias

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi again,

    oh, and if you are actually just using the table to get things side by side, a better approach might be to use a HTML based layout based on <div> elements that are styled with CSS, instead of a table.
    The best way to do that could be to use a plugin that can add a “column layout” to a page, like this one: https://www.ads-software.com/extend/plugins/grid-columns/

    Regards,
    Tobias

    Thread Starter elodieg14

    (@elodieg14)

    Dear Tobias,

    Everything is working well. Thank you.

    Regards,

    Elodie.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Elodie,

    awesome, that’s great to hear ??

    Best wishes,
    Tobias

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Insert html code’ is closed to new replies.