Changes

Add internally generated custom row support
Line 4: Line 4:     
local BaseTable = BaseData{
 
local BaseTable = BaseData{
_table_start = [[{| class="wikitable typography-xl-optout"]],
+
_table_start = [[{| class="wikitable typography-xl-optout" style="width: -moz-max-content; width: -webkit-max-content;"]],
 
_row_starter = "|-",
 
_row_starter = "|-",
 
_header_template = "",
 
_header_template = "",
Line 226: Line 226:     
function BaseTable:append_custom_row(custom_row_key)
 
function BaseTable:append_custom_row(custom_row_key)
table.insert(self._rows,  
+
if self._custom_rows and self._custom_rows[custom_row_key] then
format{self._column_cell_templates["!"] or self._cell,  
+
table.insert(self._rows, self._custom_rows[custom_row_key])
colspan = #self._columns, rowspan = 1,  
+
else
text_align = self._args[self._custom_row_prefix .. custom_row_key .. self._text_align_suffix] or self._start_align,  
+
table.insert(self._rows,
bg_color = self._args[self._custom_row_prefix .. custom_row_key .. self._bg_color_suffix] or self._transparent,
+
format{self._column_cell_templates["!"] or self._cell,  
values = {
+
colspan = #self._columns, rowspan = 1,  
value = self._args[self._custom_row_prefix .. custom_row_key .. self._content_suffix] or "",
+
text_align = self._args[self._custom_row_prefix .. custom_row_key .. self._text_align_suffix] or self._start_align,  
},
+
bg_color = self._args[self._custom_row_prefix .. custom_row_key .. self._bg_color_suffix] or self._transparent,
}
+
values = {
)
+
value = self._args[self._custom_row_prefix .. custom_row_key .. self._content_suffix] or "",
 +
},
 +
}
 +
)
 +
end
 
end
 
end
  
Anonymous user