问题
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