Modul:HTML/Work: Unterschied zwischen den Versionen

Aus FürthWiki
(+ <tbody>)
K (HeikoBot verschob die Seite Modul:Tabelle/Work nach Modul:HTML/Work, ohne dabei eine Weiterleitung anzulegen)
 
(4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 5: Zeile 5:
-- mw.logObject(frame.args, "frame.args")
-- mw.logObject(frame.args, "frame.args")
local t =  
local t =  
"<table class=\"wikitable sortable\" border=\"1\">\n" ..  
"<table class=\"wikitable sortable\" border=\"1\">\n" ..
" <tbody>\n" ..
"<tr>\n"
"    <tr>\n"
for _, a in ipairs(frame.args) do
for _, a in ipairs(frame.args) do
t = t .. "     <th>" .. a .. "</th>\n"
t = t .. " <th>" .. a .. "</th>\n"
end
end
t = t .. "   </tr>\n"
t = t .. "</tr>\n"
-- mw.logObject(t, "t")
return t
end
 
function p.TableLine(frame)
-- mw.log("TableLine(frame)")
-- mw.logObject(frame.args, "frame.args")
local t = "<tr>\n"
for _, a in ipairs(frame.args) do
t = t .. "  <td>" .. a .. "</td>\n"
end
t = t .. "</tr>\n"
-- mw.logObject(t, "t")
-- mw.logObject(t, "t")
return t
return t
Zeile 18: Zeile 29:
function p.TableFooter(frame)
function p.TableFooter(frame)
-- mw.log("TableFooter(frame)")
-- mw.log("TableFooter(frame)")
local t =
local t = "</table>\n"
"  <tbody>\n" ..
"</table>\n"
-- mw.logObject(t, "t")
-- mw.logObject(t, "t")
return t
return t

Aktuelle Version vom 12. Januar 2026, 11:18 Uhr

Die Dokumentation für dieses Modul kann unter Modul:HTML/Work/Doku erstellt werden

local p = {}

function p.TableHeader(frame)
--	mw.log("tableHeader(frame)")
--	mw.logObject(frame.args, "frame.args")
	local t = 
		"<table class=\"wikitable sortable\" border=\"1\">\n" ..
		"<tr>\n"
	for _, a in ipairs(frame.args) do
		t = t .. "  <th>" .. a .. "</th>\n"
	end
	t = t .. "</tr>\n"
--	mw.logObject(t, "t")
	return t
end

function p.TableLine(frame)
--	mw.log("TableLine(frame)")
--	mw.logObject(frame.args, "frame.args")
	local t = "<tr>\n"
	for _, a in ipairs(frame.args) do
		t = t .. "  <td>" .. a .. "</td>\n"
	end
	t = t .. "</tr>\n"
--	mw.logObject(t, "t")
	return t
end

function p.TableFooter(frame)
--	mw.log("TableFooter(frame)")
	local t = "</table>\n"
--	mw.logObject(t, "t")
	return t
end

return p