Line 39: |
Line 39: |
| local ship, nodes = arg:match(args_grammar.ship_and_nodes) | | local ship, nodes = arg:match(args_grammar.ship_and_nodes) |
| -- TODO: check ship existence? | | -- TODO: check ship existence? |
− | table.insert(tbl.rows, 1, {}) | + | table.insert(tbl.rows, {}) |
− | local row = tbl.rows[1] | + | local row = tbl.rows[#tbl.rows] |
| + | mw.log(arg_name, #tbl.rows) |
| row.id = arg_name | | row.id = arg_name |
| row.ship = ship | | row.ship = ship |
Line 67: |
Line 68: |
| | | |
| local table_format = { | | local table_format = { |
− | header = '{| class="wikitable sortable" align="center" width="100%" style="text-align:center"\n!class="headerSort headerSortDown"|#\n!Type\n!Ship\n', | + | header = '{| class="wikitable sortable" align="center" width="100%" style="text-align:center"\n!#\n!Type\n!Ship\n', |
| header_node = '!width="10%%"|%s\n', | | header_node = '!width="10%%"|%s\n', |
| header_boss_node = '!width="10%%" style="background-color:pink;color:red;"|\'\'\'%s\'\'\'\n', | | header_boss_node = '!width="10%%" style="background-color:pink;color:red;"|\'\'\'%s\'\'\'\n', |
Line 88: |
Line 89: |
| | | |
| -- rows | | -- rows |
− | for _, row in pairs(tbl.rows) do | + | for key, row in pairs(tbl.rows) do |
| + | mw.log(arg_name) |
| res = res .. table_format.row | | res = res .. table_format.row |
| res = res .. string.format(table_format.cell, row.id) | | res = res .. string.format(table_format.cell, row.id) |