Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Koha public report -> HTML table
$.get('', function(data) {
// header row
let html = '<table><thead><th>Field One</th><th>Field Two</th><th>Field Three</th></thead><tbody>'
// content rows
data.forEach(row => {
html += '<tr>'
row.forEach(value => html += `<td>${value}</td>`)
html += '</tr>'
// close tags (optional), add to DOM
html += '</tbody></table>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment