首頁
關於我們
隨機
新手使用指南
貢獻分數
百科財務報告
近期變更
特殊頁面
社群入口
設定
關於微國家百科
免責聲明
微國家百科
搜尋
使用者選單
建立帳號
登入
檢視 模組:Infobox 的原始碼
←
模組:Infobox
由於以下原因,您無權編輯此頁面:
您請求的操作只有這個群組的使用者能使用:
使用者
您可以檢視並複製此頁面的原始碼。
local p = {} function p.main(frame) local args = frame:getParent().args local root = mw.html.create("table") :addClass("infobox") :css("float", "right") :css("clear", "right") :css("margin", "0 0 1em 1em") :css("width", "300px") :css("border", "1px solid #a2a9b1") :css("border-collapse", "collapse") :css("background", "#f8f9fa") :css("font-size", "90%") local title = args.title or args.name or "" if title ~= "" then root :tag("tr") :tag("th") :attr("colspan", "2") :css("text-align", "center") :css("font-size", "125%") :css("font-weight", "bold") :css("padding", "0.4em") :css("background", "#eaecf0") :wikitext(title) :done() :done() end local image = args.image or "" if image ~= "" then local row = root:tag("tr") local cell = row :tag("td") :attr("colspan", "2") :css("text-align", "center") :css("padding", "0.5em") cell:wikitext(image) local caption = args.caption or "" if caption ~= "" then cell :tag("div") :css("font-size", "90%") :css("margin-top", "0.3em") :wikitext(caption) :done() end cell:done() row:done() end local i = 1 while true do local label = args["label" .. i] local value = args["data" .. i] if not label and not value then break end if value and value ~= "" then local row = root:tag("tr") if label and label ~= "" then row :tag("th") :css("text-align", "left") :css("vertical-align", "top") :css("padding", "0.3em 0.5em") :wikitext(label) :done() end row :tag("td") :css("vertical-align", "top") :css("padding", "0.3em 0.5em") :wikitext(value) :done() row:done() end i = i + 1 end return tostring(root) end return p
此頁面使用了以下模板:
模組:Infobox/doc
(
檢視原始碼
)
返回到「
模組:Infobox
」。