편집 요약 없음 |
태그: 편집 취소 |
||
| 1번째 줄: | 1번째 줄: | ||
local p = {} | local p = {} | ||
function p.table(frame) | |||
function p. | local args = frame:getParent().args | ||
local args = frame.args | local html = mw.html.create('table') | ||
:addClass('wikitable') | |||
:css({ | |||
['width'] = '100%', | |||
['border-collapse'] = 'collapse', | |||
['text-align'] = 'center', | |||
}) | |||
-- | -- 헤더 구성 (이미지와 동일) | ||
local | local header = { | ||
'크래프트', '습득Lv', '소비CP', '타입', '히트수', | |||
'위력', '범위', '사정', '스턴', '경직' , '효과' | |||
} | |||
local | local thead = html:tag('tr') | ||
for _, h in ipairs(header) do | |||
thead:tag('th') | |||
:css({ | |||
['background'] = '#2E3B84', | |||
['color'] = '#fff', | |||
['padding'] = '6px', | |||
}) | |||
:wikitext(h) | |||
end | |||
-- | -- 데이터 행 처리 | ||
local | local rowIndex = 0 | ||
for i = 1, 50 do -- 최대 50행 가정 | |||
local line = args['row' .. i] | |||
if not line or line == '' then break end | |||
return | rowIndex = rowIndex + 1 | ||
local bg = (rowIndex % 2 == 1) and '#EDF3FF' or 'transparent' | |||
-- 행 구조: C/SC, 이름, 습득Lv, 소비CP, 타입, 히트수, 위력, 범위, 사정, 스턴, 하드, 효과 | |||
local cols = mw.text.split(line, ',', true) | |||
local tr = html:tag('tr'):css('background', bg) | |||
for _, v in ipairs(cols) do | |||
tr:tag('td') | |||
:css({ | |||
['padding'] = '4px', | |||
}) | |||
:wikitext(v) | |||
end | |||
end | |||
return tostring(html) | |||
end | end | ||
return p | return p | ||
2025년 11월 23일 (일) 21:09 판
이 모듈에 대한 설명문서는 모듈:궤적시리즈/하늘의 궤적/캐릭터 크래프트/설명문서에서 만들 수 있습니다
local p = {}
function p.table(frame)
local args = frame:getParent().args
local html = mw.html.create('table')
:addClass('wikitable')
:css({
['width'] = '100%',
['border-collapse'] = 'collapse',
['text-align'] = 'center',
})
-- 헤더 구성 (이미지와 동일)
local header = {
'크래프트', '습득Lv', '소비CP', '타입', '히트수',
'위력', '범위', '사정', '스턴', '경직' , '효과'
}
local thead = html:tag('tr')
for _, h in ipairs(header) do
thead:tag('th')
:css({
['background'] = '#2E3B84',
['color'] = '#fff',
['padding'] = '6px',
})
:wikitext(h)
end
-- 데이터 행 처리
local rowIndex = 0
for i = 1, 50 do -- 최대 50행 가정
local line = args['row' .. i]
if not line or line == '' then break end
rowIndex = rowIndex + 1
local bg = (rowIndex % 2 == 1) and '#EDF3FF' or 'transparent'
-- 행 구조: C/SC, 이름, 습득Lv, 소비CP, 타입, 히트수, 위력, 범위, 사정, 스턴, 하드, 효과
local cols = mw.text.split(line, ',', true)
local tr = html:tag('tr'):css('background', bg)
for _, v in ipairs(cols) do
tr:tag('td')
:css({
['padding'] = '4px',
})
:wikitext(v)
end
end
return tostring(html)
end
return p