How Do I Remove Tags From An Html Table?
Just like the title says: I need a way to remove the tags from nested HTML tables. Any suggestions?Solution 1:
You can't disembody HTML tables.
If you're looking to get rid of superfluous <tbody></tbody>
tags in an HTML string, do a string replacement:
var html = '<table><tbody>...</tbody></table>'.replace(/<\/?tbody>/g, '');
$(html).appendTo('body');
But browsers are still going to put the table rows in a table body when rendering the HTML anyway.
Solution 2:
Did you try jquery remove()
function ?
Just like the title says: I need a way to remove the tags from nested HTML tables. Any suggestions?
Solution 1:
You can't disembody HTML tables.
If you're looking to get rid of superfluous <tbody></tbody>
tags in an HTML string, do a string replacement:
var html = '<table><tbody>...</tbody></table>'.replace(/<\/?tbody>/g, '');
$(html).appendTo('body');
But browsers are still going to put the table rows in a table body when rendering the HTML anyway.
Solution 2:
Did you try jquery remove()
function ?
Post a Comment for "How Do I Remove Tags From An Html Table?"