Module:ReceptionTable: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
No edit summary |
||
Line 28: | Line 28: | ||
-- Create the row with the necessary cells and rowspan |
-- Create the row with the necessary cells and rowspan |
||
local row = '|- |
local row = '|-' |
||
if volume ~= '' then |
if volume ~= '' then |
||
row = row .. '! class="receptionTableImage ' .. part .. '4 diamonds"' .. 'style="width:5%;" rowspan="' .. rowspan .. '" | ' .. volume .. '\n' |
row = row .. 'class="receptionTableSection"\n! class="receptionTableImage ' .. part .. '4 diamonds"' .. 'style="width:5%;" rowspan="' .. rowspan .. '" | ' .. volume .. '\n' |
||
end |
end |
||
row = row .. '| ' .. date .. '\n| ' .. rank .. '\n| ' .. copiesSold .. '\n| ' .. total |
row = row .. '\n| ' .. date .. '\n| ' .. rank .. '\n| ' .. copiesSold .. '\n| ' .. total |
||
return row |
return row |
||
end |
end |
Revision as of 17:03, 25 February 2024
Documentation for this module may be created at Module:ReceptionTable/doc
local p = {}
-- Function to create the header of the table
function p.header(frame)
local part = frame.args.part or 'pb'
local headerColor = frame.args.headerColor or '#ffffff'
local width = frame.args.width or '80%'
local borderColor = frame.args.borderColor or 'var(--' .. string.lower(part) .. '2)'
local header = '{| class="wikitable receptionTable diamonds" style="width:' .. width .. '; border: 2px groove ' .. borderColor .. '\n'
header = header .. '! class="receptionTableHeader ' .. part .. '" style="color:' .. headerColor .. ';" | Volume\n'
header = header .. '! class="receptionTableHeader ' .. part .. '" style="min-width:150px; color:' .. headerColor .. ';" | Date\n'
header = header .. '! class="receptionTableHeader ' .. part .. '" style="color:' .. headerColor .. ';" | Rank\n'
header = header .. '! class="receptionTableHeader ' .. part .. '" style="color:' .. headerColor .. ';" | Copies Sold\n'
header = header .. '! class="receptionTableHeader ' .. part .. '" style="color:' .. headerColor .. ';" | Total\n'
return header
end
-- Function to create a row in the table
function p.row(frame)
local part = frame.args.part or 'pb'
local volume = frame.args.volume or ''
local date = frame.args.date or ''
local rank = frame.args.rank or ''
local copiesSold = frame.args.copiesSold or ''
local total = frame.args.total or ''
local rowspan = frame.args.rowspan or 1
-- Create the row with the necessary cells and rowspan
local row = '|-'
if volume ~= '' then
row = row .. 'class="receptionTableSection"\n! class="receptionTableImage ' .. part .. '4 diamonds"' .. 'style="width:5%;" rowspan="' .. rowspan .. '" | ' .. volume .. '\n'
end
row = row .. '\n| ' .. date .. '\n| ' .. rank .. '\n| ' .. copiesSold .. '\n| ' .. total
return row
end
-- Function to close the table
function p.footer(frame)
return '|}\n'
end
return p