$('#content table tr td').children().unwrap().unwrap().unwrap().unwrap();
jQuery Remove all table elements while keeping contents intact
This one-liner "unwraps" the table elements around the contents inside. This includes td, tr, tbody, thead, tfoot and table elements. You may wish to do this only in the content area of your page, as it may damage the visual structure of a table based layout.
Snippet Viewed 2896 times.
Share your jQuery code snippets:
- Get some recognition & a link back to your site.
- Create your own code library.
- Help your fellow developers, as they have helped you.