편집 요약 없음 |
편집 요약 없음 |
||
| 11번째 줄: | 11번째 줄: | ||
}) | }) | ||
-- 헤더 구성 ( | -- 헤더 구성 (이미지와 동일한 구조) | ||
local | local headers = { | ||
' | {text = 'クラフト', colspan = 2}, | ||
' | {text = '修得Lv'}, | ||
{text = '消費CP'}, | |||
{text = 'タイプ'}, | |||
{text = 'ヒット数'}, | |||
{text = '威力', colspan = 2}, | |||
{text = '範囲'}, | |||
{text = '射程'}, | |||
{text = 'スタン'}, | |||
{text = '硬直'}, | |||
{text = '効果'} | |||
} | } | ||
local | -- 상단 헤더 (colspan 있는 헤더) | ||
for _, h in ipairs( | local topHeader = html:tag('tr') | ||
for _, h in ipairs(headers) do | |||
topHeader:tag('th') | |||
:css({ | :css({ | ||
['background'] = '#2E3B84', | ['background'] = '#2E3B84', | ||
['color'] = '#fff', | ['color'] = '#fff', | ||
['padding'] = '6px', | ['padding'] = '6px', | ||
[' | }) | ||
:attr('colspan', h.colspan or 1) | |||
:wikitext(h.text) | |||
end | |||
-- 하단 헤더 (세부 항목) | |||
local subHeaders = { | |||
'', '', '修得Lv', '消費CP', 'タイプ', 'ヒット数', '威力', '威力', '範囲', '射程', 'スタン', '硬直', '効果' | |||
} | |||
local bottomHeader = html:tag('tr') | |||
for i, h in ipairs(subHeaders) do | |||
bottomHeader:tag('th') | |||
:css({ | |||
['background'] = '#2E3B84', | |||
['color'] = '#fff', | |||
['padding'] = '4px', | |||
['border-top'] = '1px solid #fff' | |||
}) | }) | ||
:wikitext(h) | :wikitext(h) | ||
| 31번째 줄: | 58번째 줄: | ||
-- 데이터 행 처리 | -- 데이터 행 처리 | ||
local rowIndex = 0 | local rowIndex = 0 | ||
for i = 1, 50 do | for i = 1, 50 do | ||
local line = args['row' .. i] | local line = args['row' .. i] | ||
if not line or line == '' then break end | if not line or line == '' then break end | ||
| 38번째 줄: | 65번째 줄: | ||
local bg = (rowIndex % 2 == 1) and '#EDF3FF' or 'transparent' | local bg = (rowIndex % 2 == 1) and '#EDF3FF' or 'transparent' | ||
-- 행 구조: 종류 | -- 행 구조: 종류, 이름, 습득Lv, 소비CP, 타입, 히트수, 위력등급, 위력수치, 범위, 사정, 스턴, 경직, 효과 | ||
local cols = mw.text.split(line, ',', true) | local cols = mw.text.split(line, ',', true) | ||
| 80번째 줄: | 107번째 줄: | ||
:wikitext(cols[6] or '') | :wikitext(cols[6] or '') | ||
-- 위력 ( | -- 위력 등급 | ||
tr:tag('td') | |||
:css('padding', '4px') | |||
:wikitext(cols[7] or '') | |||
-- 위력 수치 | |||
tr:tag('td') | tr:tag('td') | ||
:css('padding', '4px') | :css('padding', '4px') | ||
:wikitext | :wikitext(cols[8] or '') | ||
-- 범위 | -- 범위 | ||
2025년 11월 23일 (일) 21:14 판
이 모듈에 대한 설명문서는 모듈:궤적시리즈/하늘의 궤적/캐릭터 크래프트/설명문서에서 만들 수 있습니다
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 headers = {
{text = 'クラフト', colspan = 2},
{text = '修得Lv'},
{text = '消費CP'},
{text = 'タイプ'},
{text = 'ヒット数'},
{text = '威力', colspan = 2},
{text = '範囲'},
{text = '射程'},
{text = 'スタン'},
{text = '硬直'},
{text = '効果'}
}
-- 상단 헤더 (colspan 있는 헤더)
local topHeader = html:tag('tr')
for _, h in ipairs(headers) do
topHeader:tag('th')
:css({
['background'] = '#2E3B84',
['color'] = '#fff',
['padding'] = '6px',
})
:attr('colspan', h.colspan or 1)
:wikitext(h.text)
end
-- 하단 헤더 (세부 항목)
local subHeaders = {
'', '', '修得Lv', '消費CP', 'タイプ', 'ヒット数', '威力', '威力', '範囲', '射程', 'スタン', '硬直', '効果'
}
local bottomHeader = html:tag('tr')
for i, h in ipairs(subHeaders) do
bottomHeader:tag('th')
:css({
['background'] = '#2E3B84',
['color'] = '#fff',
['padding'] = '4px',
['border-top'] = '1px solid #fff'
})
:wikitext(h)
end
-- 데이터 행 처리
local rowIndex = 0
for i = 1, 50 do
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'
-- 행 구조: 종류, 이름, 습득Lv, 소비CP, 타입, 히트수, 위력등급, 위력수치, 범위, 사정, 스턴, 경직, 효과
local cols = mw.text.split(line, ',', true)
local tr = html:tag('tr'):css('background', bg)
-- 종류 (C/SC)
tr:tag('td')
:css({
['padding'] = '4px',
['font-weight'] = 'bold'
})
:wikitext(cols[1] or '')
-- 크래프트 이름
tr:tag('td')
:css({
['padding'] = '4px',
['font-weight'] = 'bold',
['text-align'] = 'left'
})
:wikitext(cols[2] or '')
-- 습득Lv
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[3] or '')
-- 소비CP
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[4] or '')
-- 타입
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[5] or '')
-- 히트수
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[6] or '')
-- 위력 등급
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[7] or '')
-- 위력 수치
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[8] or '')
-- 범위
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[9] or '')
-- 사정
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[10] or '')
-- 스턴
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[11] or '')
-- 경직
tr:tag('td')
:css('padding', '4px')
:wikitext(cols[12] or '')
-- 효과
tr:tag('td')
:css({
['padding'] = '4px',
['text-align'] = 'left'
})
:wikitext(cols[13] or '')
end
return tostring(html)
end
return p