m4q icon indicating copy to clipboard operation
m4q copied to clipboard

M4Q append td

Open KlumsD opened this issue 2 years ago • 2 comments

Hi Olton,

Describe the bug $("< td>td content< /td>"); is not returning an HTMLElement.

To Reproduce https://codepen.io/KlumsD/pen/jOLrwbd Adding js generated td to a table. if empty,

it is added. if not empty, it isn't added.

Same for < tr>

Expected behavior It should work as the < p > exemple here : https://metroui.org.ua/m4q-manipulation.html

Screenshots image

Desktop (please complete the following information):

  • OS: Win
  • Browser Firefox
  • Metro Version v4.5.0

Thanks !

Best Regards

KlumsD avatar Oct 19 '21 14:10 KlumsD

Thanks for opening a new issue. The author has been notified and will review it as soon as possible. For urgent issues and priority support, visit https://xscode.com/olton/Metro-UI-CSS or Patreon

xscode-auto-reply[bot] avatar Oct 19 '21 14:10 xscode-auto-reply[bot]

Hi Olton,

I've found this issue on StackOverflow which explain the problem of <tr> <td> etc.

Searching the subject, I found a neat workaround solution with great browser compatibility: insertAdjacentHTML

Cool Stacks about the same subject :

  • https://stackoverflow.com/questions/6304453/javascript-append-html-to-container-element-without-innerhtml
  • https://stackoverflow.com/questions/7327056/appending-html-string-to-the-dom
  • https://stackoverflow.com/questions/1387433/fastest-way-to-append-html-content-to-a-div-using-javascript

Mozilla Doc:

  • https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML

Ex : document.getElementById('tableBody').insertAdjacentHTML('beforeend', trElement);

Best Regards

KlumsD avatar Nov 04 '21 21:11 KlumsD