Created
January 7, 2020 18:05
-
-
Save phette23/3d8a58fd5200b255914929b8efcd493f to your computer and use it in GitHub Desktop.
Koha public report -> HTML table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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