打开/关闭搜索
搜索
打开/关闭菜单
549
7
12
2051
OGAS数据中枢
导航
首页
最近更改
随机页面
特殊页面
上传文件
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁Module:GFBlocks”︁的源代码
来自OGAS数据中枢
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
Module:GFBlocks
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
管理员
您可以查看和复制此页面的源代码。
local p = {} local getArgs = require('Module:Arguments').getArgs function p._main(args) -- 初始化单元格颜色 local cells = {} for i = 1, 9 do cells[i] = '6b6b6b' end -- 处理数字参数(顺序参数) local firstValue for i, value in ipairs(args) do local num = tonumber(value) if num and num >= 1 and num <= 9 then if i == 1 then cells[num] = 'f0f0f0' firstValue = value else if value ~= firstValue then cells[num] = '00fedc' end end end end -- 处理命名参数(颜色覆盖) for key, color in pairs(args) do if type(key) == 'string' then local num = tonumber(key:match('^color(%d)$')) if num and num >= 1 and num <= 9 then cells[num] = color:gsub('#', '') end end end -- 获取宽度参数 local width = args.width or '20' -- 生成HTML表格 local html = { '<TABLE border="2" cellpadding="1" style="border-collapse:separate;border-spacing:1px;margin:0 auto">', string.format('<TR><TD BGCOLOR="#%s" height="%s" width="%s"> <TD BGCOLOR="#%s" height="%s" width="%s"> <TD BGCOLOR="#%s" height="%s" width="%s"></TR>', cells[7], width, width, cells[8], width, width, cells[9], width, width), string.format('<TR><TD BGCOLOR="#%s" height="%s" width="%s"><TD BGCOLOR="#%s" height="%s" width="%s"><TD BGCOLOR="#%s" height="%s" width="%s"></TR>', cells[4], width, width, cells[5], width, width, cells[6], width, width), string.format('<TR><TD BGCOLOR="#%s" height="%s" width="%s"><TD BGCOLOR="#%s" height="%s" width="%s"><TD BGCOLOR="#%s" height="%s" width="%s"></TR>', cells[1], width, width, cells[2], width, width, cells[3], width, width), '</TABLE>' } return table.concat(html) end function p.main(frame) local args = getArgs(frame, { parentFirst = true, }) return p._main(args) end return p
该页面嵌入的页面:
Module:GFBlocks/doc
(
查看源代码
)
返回
Module:GFBlocks
。
查看“︁Module:GFBlocks”︁的源代码
来自OGAS数据中枢