Module:Testcase table: Difference between revisions

Content deleted Content added
No edit summary
optional style
Line 8:
local basepagename = mw.ustring.gsub(mw.title.getCurrentTitle().text, '/.*$', '');
local tableclass = ''
local tablestyle = ''
local template1 = args['_template1'] or args['_template'] or (basepagename)
local template2 = args['_template2'] or (template1 .. '/sandbox')
Line 18 ⟶ 19:
if( args['_rowheader'] ) then
rowheader = '<tdth scope=row>' .. args['_rowheader'] .. '</tdth>'
heading0 = '<th>' .. (args['_heading0'] or '') .. '</th>'
end
Line 24 ⟶ 25:
tableclass = ' class="' .. args['_class'] .. '"'
end
if( args['_style'] ) then
tablestyle = ' style"' .. args['_style'] .. '"'
end
for k, v in pairs(args) do
t[k] = v
Line 30 ⟶ 33:
return mw.ustring.format( [==[
<table%s%s><caption>%s</caption>
<tr>%s<th style="width:50%%">%s</th><th style="width:50%%">%s</th></tr>
<tr style="vertical-align:top">%s<td>
%s</td><td>
%s</td></tr></table>]==],
tableclass, tablestyle, caption,
heading0, heading1, heading2, rowheader,
frame:expandTemplate{ title = template1, args = t },