Tag:TR

  • JS regular matching table tr

    Time:2021-10-23

    I think it’s simpler than ijao, but my brain just can’t turn…. Please have a look. <textarea id=”txt”>  <table border=1 width=”20%”>                    <tr><th>title</th><th>title2</th></tr>             <tr rs=”{id:\’section006\’}”><td>data1</td><td>data2      </td>             </tr>             <tr ><td>data1</td><td>data2</td></tr>  </table>  </textarea>  <script>  var str = document.getElementById(‘txt’).value;  alert(str);  </script> /<tr[^>]*>[\s\S]*?<\/tr>/gi, Share a function //General replacement function doRepNormal(s){ var str=s.replace(/<p><br type=”_moz”>\s*?<\/p>/ig,””); str=str.replace(/<p>\s*?<br type=”_moz”>\s*?<\/p>/ig, “”); str=str.replace(/<p>(\s|\&nbsp\;| | |\xc2\xa0)*?<\/p>/ig, “”); str=str.replace(/<p>\s*?<\/p>/ig,””); str=str.replace(/<p>&nbsp;<\/p>/ig,””); str=str.replace(/<br type=”_moz”>\n&nbsp;<\/p>/ig, “</p>”); str=str.replace(/<br type=”_moz”>\s*?<\/p>/ig, “</p>”); str=str.replace(/<br\s*?\/?>\s*?<\/p>/ig, “</p>”); […]

  • Converting XML data into HTM

    Time:2019-4-6

    Use a simpleXSLStyle sheets can convert XML data intoHTML。 With the evolution of the XML specification, it seems necessary to meet everyone’s needs in the new version; assuming there is an XML data that represents the content of a page, now you want to convert its content into a layout. Here is the XML you […]