Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Last active October 11, 2021 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpluimers/8188dbdb643b1d6b0e5ef4b397b79e23 to your computer and use it in GitHub Desktop.
Save jpluimers/8188dbdb643b1d6b0e5ef4b397b79e23 to your computer and use it in GitHub Desktop.
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