Lompat ke isi

Modul:CustomTableHandler

Ḍâri Wikipèḍia bhâsa Madhurâ, lombhung pangataowan mardhika
Rèvisi sajjhek 16 Jânuwari 2025 11.18 bi' Munajad.MH (kanḍhâ | dhurrun) (←Membuat halaman berisi 'local p = {} function p.createTable(frame) local include_in = frame.args.include_in local dialeks = frame.args.dialeks or "" local rows = frame.args.rows or "" -- Build the header local header = "{| class=\"wikitable\" width=\"100%\" style=\"text-align:center;\"\n|-\n" if include_in and include_in ~= "" then header = header .. "! " .. include_in .. "\n" end for dialek in string.gmatch(dialeks, "[^|]+") do header...')
(bhidhâ) ← Rèvisi sabelluna | Rèvisi jângkènè (bhidhâ) | Rèvisi lebbi anyar → (bhidhâ)

Dokumentasi untuk modul ini dapat dibuat di Modul:CustomTableHandler/doc

local p = {}

function p.createTable(frame)
    local include_in = frame.args.include_in
    local dialeks = frame.args.dialeks or ""
    local rows = frame.args.rows or ""

    -- Build the header
    local header = "{| class=\"wikitable\" width=\"100%\" style=\"text-align:center;\"\n|-\n"
    if include_in and include_in ~= "" then
        header = header .. "! " .. include_in .. "\n"
    end

    for dialek in string.gmatch(dialeks, "[^|]+") do
        header = header .. "! " .. dialek .. "\n"
    end

    -- Add the rows
    local body = ""
    for row in string.gmatch(rows, "[^\n]+") do
        body = body .. "|-\n" .. row .. "\n"
    end

    -- Close the table
    local table_end = "|}"

    return header .. body .. table_end
end

return p