Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Last active Oct 11, 2021
Embed
What would you like to do?
Convert a `dl` with id `delimitedList` into a `table` within a `div` named `here_table`, adopted from https://stackoverflow.com/questions/26386817/rebuild-each-definition-list-dl-as-a-table-using-jquery/26387182#26387182
<table id="here_table"></table>
var arr = $("#delimitedList").children().map(function () {
return $(this).html();
}).get();
for (var i = 0; i < arr.length; i += 2) {
$('#here_table').append('<tr><td>' + arr[i] + '</td><td>' + arr[i + 1] + '</td></tr>');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment