| This is the template test cases page for the sandbox of Template:Syntaxhighlight. to update the examples. If there are many examples of a complicated template, later ones may break due to limits in MediaWiki; see the HTML comment "NewPP limit report" in the rendered page. You can also use Special:ExpandTemplates to examine the results of template uses. You can test how this page looks in the different skins and parsers with these links: |
Live template
editBare syntaxhighlight tags
edit<!-- This is a comment; these are not displayed in the browser. -->
<table class="center" style="background-color: ivory; color: maroon; font-family: Arial, sans-serif; font-size: 0.875rem; font-style: italic; font-weight: 700;">
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
<tr>
<td style="padding: 10px;">This is cell 1 text</td>
<td style="padding: 10px;">This is cell 2 text</td>
</tr>
</table>
Template:Syntaxhighlight invocation
edit<table class="center" style="background-color: ivory; color: maroon; font-family: Arial, sans-serif; font-size: 0.875rem; font-style: italic; font-weight: 700;">
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
<tr>
<td style="padding: 10px;">This is cell 1 text</td>
<td style="padding: 10px;">This is cell 2 text</td>
</tr>
</table>
Template:Syntaxhighlight/sandbox invocation
edit <table class="center" style="background-color: ivory; color: maroon; font-family: Arial, sans-serif; font-size: 0.875rem; font-style: italic; font-weight: 700;">
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
<tr>
<td style="padding: 10px;">This is cell 1 text</td>
<td style="padding: 10px;">This is cell 2 text</td>
</tr>
</table>
Use of inline= parameter to display as inline-block
edit{{Syntaxhighlight|{{#parsoid
{{Syntaxhighlight}}
This is inline output, so start a sentence…{{CodeCommentary|Python:A language of, by and for the sneks}}
{{CodeCommentary|Python:A language of, by and for the sneks}}
This is inline output, so start a sentence…{{CodeCommentary|Python:A language of, by and for the sneks}}…and now end the sentence.
Copy parameter test
edit{{Syntaxhighlight|code=<table style="width: 100%;">
<tr><th>Heading 1</th><th>Heading 2</th></tr>
<tr><td style="padding: 10px;">This is cell 1 text</td><td style="padding: 10px;">This is cell 2 text</td></tr>
</table> |copy=1 |lang=HTML}}
{{Syntaxhighlight}}
<table style="width: 100%;">
<tr><th>Heading 1</th><th>Heading 2</th></tr>
<tr><td style="padding: 10px;">This is cell 1 text</td><td style="padding: 10px;">This is cell 2 text</td></tr>
</table>
<table style="width: 100%;">
<tr><th>Heading 1</th><th>Heading 2</th></tr>
<tr><td style="padding: 10px;">This is cell 1 text</td><td style="padding: 10px;">This is cell 2 text</td></tr>
</table>