Module:Testcase table: Difference between revisions

Content deleted Content added
No edit summary
add feature per request
Line 7:
local args = frame:getParent().args
local basepagename = mw.ustring.gsub(mw.title.getCurrentTitle().text, '/.*$', '');
local tableclass = ''
local template1 = args['_template1'] or args['_template'] or (basepagename)
local template2 = args['_template2'] or (template1 .. '/sandbox')
Line 21 ⟶ 22:
heading0 = '<th>' .. args['_heading0'] .. '</th>'
end
end
if( args['_class'] ) then
tableclass = ' class="' .. args[_class] .. '"'
end
Line 28 ⟶ 32:
return mw.ustring.format( [==[
<table%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, caption,
heading0, heading1, heading2, rowheader,
frame:expandTemplate{ title = template1, args = t },