How can I use jQuery to convert <div> into HTML table?
问题 <div> Hii,this is just an example </div> change to <td>Hii, only tag will be change </td> 回答1: in case someone needs to convert on the-fly: var div2table = $('.outer-div ').map(function () { var issue = $(this); var trline = issue.find('.inner-div').map(function () { return '<td>' + $(this).text(); }).get().join('</td>'); return '<tr>' + trline; }).get().join('</tr>'); div2table = '<table>' + div2table + '</table>'; where divs are <div class='outer-div'><div class='inner-div'>this will be 1st