Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Koha public report -> HTML table
$.get('https://library.cca.edu/cgi-bin/koha/svc/report?id=130', 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>'
$('body').append(html)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment