Module:Side box: Difference between revisions

    (add newlines)
    (add more newlines)
    Line 81: Line 81:
    -- The "above" row
    -- The "above" row
    if data.above then
    if data.above then
    local aboveCell = root:tag('tr'):tag('td')
    local aboveCell = root:newline()tag('tr'):tag('td')
    aboveCell
    aboveCell
    :attr('colspan', data.imageright and 3 or 2)
    :attr('colspan', data.imageright and 3 or 2)
    Line 97: Line 97:


    -- The body row
    -- The body row
    local bodyRow = root:newline():tag('tr')
    local bodyRow = root:newline():tag('tr'):newline()
    if data.image then
    if data.image then
    bodyRow:tag('td')
    bodyRow:tag('td')
    Line 105: Line 105:
    bodyRow:tag('td'):css('width', '1px')
    bodyRow:tag('td'):css('width', '1px')
    end
    end
    local textCell = bodyRow:tag('td')
    local textCell = bodyRow:newline():tag('td')
    textCell:addClass('mbox-text plainlist')
    textCell:addClass('mbox-text plainlist')
    if data.textstyle then
    if data.textstyle then
    Line 112: Line 112:
    textCell:wikitext(data.text)
    textCell:wikitext(data.text)
    if data.imageright then
    if data.imageright then
    bodyRow:tag('td')
    bodyRow:newline():tag('td')
    :addClass('mbox-imageright')
    :addClass('mbox-imageright')
    :wikitext(data.imageright)
    :wikitext(data.imageright)
    end
    end
    textCell:newline()


    -- The below row
    -- The below row
    Line 126: Line 127:
    belowCell:cssText(data.textstyle)
    belowCell:cssText(data.textstyle)
    end
    end
    belowCell:wikitext(data.below)
    belowCell
    :wikitext(data.below)
    :newline()
    end
    end