Aller au contenu

Module:Histoire

De Wikiquestia
Version datée du 2 juin 2025 à 15:01 par Alakihel (discussion | contributions) (Page créée avec « local p = {} function p.afficher(frame) local html = {} for i = 1, 10 do local titre = frame.args["titre" .. i] local contenu = frame.args["contenu" .. i] if titre or contenu then table.insert(html, "<tr>") if titre then table.insert(html, '<th scope="row">' .. titre .. "</th>") else table.insert(html, "<th></th>") end if contenu then... »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)

La documentation pour ce module peut être créée à Module:Histoire/doc

local p = {}

function p.afficher(frame)
    local html = {}
    for i = 1, 10 do
        local titre = frame.args["titre" .. i]
        local contenu = frame.args["contenu" .. i]
        if titre or contenu then
            table.insert(html, "<tr>")
            if titre then
                table.insert(html, '<th scope="row">' .. titre .. "</th>")
            else
                table.insert(html, "<th></th>")
            end
            if contenu then
                table.insert(html, "<td>" .. contenu .. "</td>")
            else
                table.insert(html, "<td></td>")
            end
            table.insert(html, "</tr>")
        end
    end
    return table.concat(html, "\n")
end

return p