2,869
edits
No edit summary |
No edit summary |
||
| (7 intermediate revisions by the same user not shown) | |||
| Line 12: | Line 12: | ||
function p.createCrossTable(frame) | function p.createCrossTable(frame) | ||
for _, study in ipairs(studies) do | |||
local count = 0 | |||
for _ in pairs(study.biomarkers) do | |||
count = count + 1 | |||
end | |||
study.count = count | |||
end | |||
-- Start of the wiki table | -- Start of the wiki table | ||
local wikitable = '{| class="wikitable sortable"\n' | local wikitable = '{| class="wikitable sortable"\n' | ||
local sep = '' | |||
for i, row in ipairs(rows) do | for i, row in ipairs(rows) do | ||
wikitable = wikitable .. '|-\n' | wikitable = wikitable .. sep | ||
wikitable = wikitable .. ' | sep = '|-\n' | ||
wikitable = wikitable .. '! colspan="3" | ' .. row.name .. '\n' | |||
for _, study in ipairs(studies) do | for _, study in ipairs(studies) do | ||
local cellValue = study[row.key] or "" | local cellValue = study[row.key] or "" | ||
if (row.rotate) then | |||
cellValue = p.template(frame, "VerticalText", cellValue) | |||
else | |||
end | |||
wikitable = wikitable .. '! ' .. cellValue .. '\n' | |||
end | end | ||
end | end | ||