|
|
Line 5: |
Line 5: |
| <includeonly> | | <includeonly> |
| <script> | | <script> |
| // Wait for the other scripts to be ready because we need jQuery
| | /* |
| window.addEventListener('load', function () {
| |
|
| |
| /**
| |
| * Add a row to a table
| |
| *
| |
| * @param {jQuery} $table The jQuery object for the table element
| |
| * @param {Array} cells An array of cells to add to the table
| |
| * @param {Object} attrs Any attributes to set on the row
| |
| * @return {jQuery} The row jQuery object
| |
| */
| |
| function addRowToTable($table, cells, attrs = {}) {
| |
| // Figure out tbody
| |
| const $tbody = $table.find('tbody');
| |
|
| |
| // Create an empty row
| |
| let $row = $(`<tr></tr>`);
| |
| | |
| // Iterate over each cell
| |
| for (let i = 0; i < cells.length; i++) {
| |
| // Get the cell
| |
| | |
| </script> | | </script> |
| </includeonly> | | </includeonly> |