Is there a way to stop ASP.NET CreateUserWizard from adding tables into HTML?

不羁岁月 提交于 2019-12-11 12:42:48

问题


How can I remove the html <table> elements that are generated by the CreateUserWizard to validate the login page against HTML 5?

I've managed to get my entire site to validate to HTML 5, except for 3 errors caused by the CreateUserWizard in my login page.

This is the code that causes the errors, which I can't seem to stop from being generated:

<table id="ContentPlaceHolder1_CreateUserWizard1">
<tr style="height:100%;">
    <td><table cellspacing="0" cellpadding="0" style="height:100%;width:100%;border-collapse:collapse;">
        <tr>
            <td style="height:100%;width:100%;">

回答1:


with jquery:

$('table').replaceWith( $('table').html()
   .replace(/<tbody/gi, "<div id='table'")
   .replace(/<tr/gi, "<div")
   .replace(/<\/tr>/gi, "</div>")
   .replace(/<td/gi, "<span")
   .replace(/<\/td>/gi, "</span>")
   .replace(/<\/tbody/gi, "<\/div")
);

or, you can try https://github.com/ryandoom/jquery-plugin-table-to-div



来源:https://stackoverflow.com/questions/22390520/is-there-a-way-to-stop-asp-net-createuserwizard-from-adding-tables-into-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!