“模块:Dict”的版本间的差异
来自希灵百科
第11行: | 第11行: | ||
local res = "" | local res = "" | ||
local N = 0 | local N = 0 | ||
− | local Table_Begin = '{| width="100%" <br>' | + | local Table_Begin = '{| border="1" width="100%" style="border-collapse:collapse" <br>' |
− | local Table_End = " | + | local Table_End = "|}" |
− | + | res = res .. Table_Begin | |
for a,SN in pairs(SerilNum) do | for a,SN in pairs(SerilNum) do | ||
− | res = res .. " " | + | res = res .."|-" |
+ | res = res .. '| width="25%" style="text-align:center;"| ' .. SN .."系列词条 ||" | ||
for b,list in pairs(dictionary[SN]) do | for b,list in pairs(dictionary[SN]) do | ||
− | res = res .. b .. " [[" .. list .."]] | + | res = res .. b .. " [[" .. list .."]] " |
--[[ N = N+1 | --[[ N = N+1 | ||
if N == 5 then | if N == 5 then | ||
第27行: | 第28行: | ||
end | end | ||
− | res = res .." <br>" | + | res = res .."| <br>" |
end | end | ||
− | + | res = res .. Table_End | |
return tostring(res) | return tostring(res) |
2020年5月10日 (日) 03:19的版本
local p = {} local getArgs = require("Module:Arguments").getArgs local dictionary = mw.loadData("Module:Dict/Data") function p.DictIndex(frame) local DictDate = {} local SerilNum = {"A","C","D","F","G","H"} --local SerilNum = {"A","C"} local res = "" local N = 0 local Table_Begin = '{| border="1" width="100%" style="border-collapse:collapse" <br>' local Table_End = "|}" res = res .. Table_Begin for a,SN in pairs(SerilNum) do res = res .."|-" res = res .. '| width="25%" style="text-align:center;"| ' .. SN .."系列词条 ||" for b,list in pairs(dictionary[SN]) do res = res .. b .. " [[" .. list .."]] " --[[ N = N+1 if N == 5 then res = res .." <br>" end]] end res = res .."| <br>" end res = res .. Table_End return tostring(res) end return p