Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #104003
    Dark Beccio
    Participant

    hi,

    is it possible to retrive the html content of the scheduler without the style properties?

    <table aria-rowcount=”8″ aria-colcount=”2″ resizable=”undefined” style=”box-sizing: border-box; border-collapse: collapse; width: 245px; empty-cells: show; border-spacing: 0px; table-layout: fixed; color: rgb(90, 90, 90); font-family: Roboto, &quot;Helvetica Neue&quot;, sans-serif; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; background-color: rgb(254, 254, 254);”><tbody style=”box-sizing: border-box;”><tr style=”box-sizing: border-box;”><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: 102.479px; min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”></td><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>Valori Medi per 100g</td></tr><tr style=”box-sizing: border-box;”><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>Energia</td><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>1120kj</td></tr><tr style=”box-sizing: border-box;”><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”></td><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>268kcal</td></tr><tr style=”box-sizing: border-box;”><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>Grassi</td><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>0,5g</td></tr><tr style=”box-sizing: border-box;”><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>Carboidrati</td><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>59,5g</td></tr><tr style=”box-sizing: border-box;”><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>di cui Zuccheri</td><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>7,2g</td></tr><tr style=”box-sizing: border-box;”><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>Proteine</td><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>8,1g</td></tr><tr style=”box-sizing: border-box;”><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>Sale</td><td style=”box-sizing: border-box; border: var(–smart-border-width) solid var(–smart-border); width: var(–smart-editor-table-column-width); min-height: var(–smart-editor-table-cell-min-height); min-width: var(–smart-editor-table-cell-min-width); padding: 2px 5px; vertical-align: middle;”>0,73g</td></tr></tbody></table>

    this is what i get from getHTML() but i only need the html tag without width,padding,style ecc.

    TY

    #104009

    Hi,

    You can select every child element, remove the style property, and then get the inner HTML.
    const table = document.querySelector(‘table’);
    table.removeAttribute(‘style’);

    const tableElements = table.querySelectorAll(‘*’);
    tableElements.forEach(el => el.removeAttribute(‘style’))

    console.log(table.innerHTML);

    I hope this helps, if not, do not hesitate to contact us!

    Best Regards,
    Svetoslav Borislavov

    Smart UI Team
    https://www.htmlelements.com/

    #104043
    Dark Beccio
    Participant

    solved ty

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.