Line 51: |
Line 51: |
| }, | | }, |
| _cell = [[| style="text-align: ${text_align}; padding:5px 5px 5px 5px;" |${value}]], | | _cell = [[| style="text-align: ${text_align}; padding:5px 5px 5px 5px;" |${value}]], |
− | _empty_cell = [[| colspan="1" rowspan="1" |]],
| |
| _item_class = Ship, | | _item_class = Ship, |
| _class_number_template = "${class_name}<br />#${class_number}", | | _class_number_template = "${class_name}<br />#${class_number}", |
Line 190: |
Line 189: |
| ShipListKai.process_item_key = Ship.process_item_key | | ShipListKai.process_item_key = Ship.process_item_key |
| | | |
− | function BaseTable:build_rows()
| + | ShipListKai.build_rows = ShipListKai.build_rows_breaks_as_empty_rows |
− | for index, row_values in ipairs(self._data_rows) do
| |
− | table.insert(self._rows, self._row_starter)
| |
− | if row_values == "break" then
| |
− | for i=1, #self._columns do
| |
− | table.insert(self._rows, self._empty_cell)
| |
− | end
| |
− | elseif row_values == "header" then
| |
− | table.insert(self._rows, self._header)
| |
− | elseif type(row_values) == "table" then
| |
− | for _, column in ipairs(self._columns) do
| |
− | if row_values[column] then
| |
− | table.insert(self._rows, format(self._column_cell_templates[column] or self._cell, row_values[column]))
| |
− | end
| |
− | end
| |
− | else
| |
− | table.insert(self._rows,
| |
− | format{self._cell,
| |
− | colspan = #self._columns, rowspan = 1,
| |
− | text_align = self._args[self._custom_row_prefix .. row_values .. self._text_align_suffix] or self._start_align,
| |
− | bg_color = self._args[self._custom_row_prefix .. row_values .. self._bg_color_suffix] or self._transparent,
| |
− | values = {
| |
− | value = self._args[self._custom_row_prefix .. row_values .. self._content_suffix] or "",
| |
− | },
| |
− | }
| |
− | )
| |
− | end
| |
− | end
| |
− | end
| |
| | | |
| function ShipListKai:create_header() | | function ShipListKai:create_header() |