Template:Markup HTML Rendered/doc

From Wikipedia, the free encyclopedia

This template is used to present Wikitext markup side by side with the HTML it produces and the output it renders.

Usage[edit]

{{Markup HTML Rendered}}'s arguments should be provided in sets of three. The first of the set should be Wikitext enclosed in <nowiki> tags. The second should be HTML, also enclosed in <nowiki> tags. The third is usually identical to the first, but without <nowiki> tags. The template accepts up to 39 unnamed parameters, resulting in up to 13 rows of examples.

This:

{{Markup HTML Rendered|<nowiki>'''Bold text'''</nowiki>|<nowiki><b>Bold text</b></nowiki>|'''Bold text'''}}

Produces this:

Wikitext HTML Renders as
'''Bold text'''
<b>Bold text</b>

Bold text

In many cases, the markup for both columns are identical, but there are instances where this may need to differ. For guidance and examples of more complex usage, see Template:Markup/doc.

Examples[edit]

Multiple rows[edit]

Wikitext HTML Renders as
'''Bold text'''
<b>Bold text</b>

Bold text

''Italic text''
<i>Italic text</i>

Italic text

[[Internal link]]
<a href="https://en.wikipedia.org/wiki/Internal_link">Internal link</a>

With custom title and column headers[edit]

How to write about foxes and dogs in Wikipedia.
Write this in wikitext HTML markup HTML markup
Some '''bold''' text
Some <b>bold</b> text

Some bold text

See also[edit]

  • {{Markup}} for two-column code and output

TemplateData[edit]

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Markup HTML Rendered in articles based on its TemplateData.

TemplateData for Markup HTML Rendered

Template parameters

ParameterDescriptionTypeStatus
margin-leftmargin-left

To set a margin on the table's lefthand side.

Default
0
Stringoptional
widthwidth

To set the table's overall width.

Default
auto
Stringoptional
stylestyle

For CSS styles amending the table's overall appearance.

Stringoptional
noheadersnoheaders

Set (as e.g. noheaders=on) to suppress the columns' headings and table's title.

Stringoptional
titletitle

Title above table.

Default
none
Stringoptional
colheaderstylecolheaderstyle

For CSS styling to amend the appearance of each column's heading.

Stringoptional
col1headerstylecol1headerstyle

For CSS styling to amend the appearance of the first column's heading. Overrides (but does not replace) colheaderstyle.

Stringoptional
col1col1

First column (Wikitext)'s heading.

Default
"Markup"
Stringoptional
col2headerstylecol2headerstyle

For CSS styling to amend the appearance of the second column's heading. Overrides (but does not replace) colheaderstyle.

Stringoptional
col2col2

Second column (HTML)'s heading.

Default
"Renders as"
Stringoptional
col3headerstylecol3headerstyle

For CSS styling to amend the appearance of the third column's heading. Overrides (but does not replace) colheaderstyle.

Stringoptional
col3col3

Third column (output)'s heading.

Default
"Renders as"
Stringoptional
Column 1 Stylecol1style

For CSS styles to amend the appearance of the Wikitext column (e.g. width of the column).

Default
none
Example
width:20em;
Stringoptional
Column 2 Stylecol2style

For CSS styles to amend the appearance of the HTML column (e.g. the background colour).

Default
none
Example
background-color:#fff;
Stringoptional
Column 3 Stylecol3style

For CSS styles to amend the appearance of the output column (e.g. the background colour).

Default
none
Example
background-color:#fff;
Stringoptional
Markup text stylecodestyle markupstyle

Use CSS style code to change the appearance of content (text) in the Markup column.

Example
white-space: nowrap;
Stringoptional
Output text styleoutputstyle

Use CSS style code to change the appearance of content (text) in the Renders-as column.

Example
white-space: nowrap;
Stringoptional
11

row 1, Wikitext markup (first column).

Stringoptional
22

row 1, HTML markup (second column).

Stringoptional
33

row 1, rendered output (third column).

Stringoptional
3737

First column's content in last possible row.

Stringoptional
3838

Second column's content in last possible row.

Stringoptional
3939

Third column's content in last possible row.

Stringoptional