Anonymous
Not logged in
Talk
Contributions
Create account
Log in
Search
Editing
DPL3/Parameters: Controlling output format
(section)
From KB42
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
Edit source
History
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===tablerow=== {{DPL parameter |name = tablerow |purpose= a simple syntax to create customized tabular output; see also {{dpl3|table}} }} Syntax: {{DPL syntax|tablerow=''coldef'', ..}} Where ''coldef'' contains wiki code which uses the symbol '%%' to refer to the corresponding element of an {{dpl3|include}} statement. The {{dpl3|table}} statement (which '''must''' be used as a prerequisite for {{dpl3|tablerow}}) cares for the basics of table generation. So, when you define a column definition, you only need to specify the code for the field contents itself. You can start with field attributes like "bgcolor" or skip them. You can add a leading {{code|\n}} or {{code|¶}} to make sure that the field contents are displayed correctly if it contains wiki syntax that depends on linebreaks (e.g. enumeration list). You must specify all columns. i.e. you must have as many entries in the {{dpl3|tablerow}} statement as there are columns in your table. Skipping a column would suppress output for that column completely. The {{dpl3|tablerow}} command is best explained by an example: <pre><nowiki> <dpl> category=Help titlematch=DPL% count=4 includepage ={DPL Manual}:section,%-1[25] table =,Title,Sub Title,Last Section (25 chars) tablerow =style="text-align:center;background-color:lightyellow;"|%%,|%%, </dpl> </nowiki></pre> <dpl> category=Help titlematch=DPL% count=4 includepage ={DPL Manual}:section,%-1[25] table =,Title,Sub Title,Last Section (25 chars) tablerow =style="text-align:center;background-color:lightyellow;"|%%,|%%, </dpl> The following example includes the use of {{dpl3|addpagecounter}} and {{tt|%COUNT%}}, both of which were removed in MediaWiki 1.25. <pre><nowiki> <dpl> category=African Union member states nottitlematch=Sudan addpagecounter=true includepage ={Infobox Country or territory}:area:population_estimate,%0[100] format =,,\n|style="text-align:right;"|²{#ifexpr:%COUNT%>300¦<big>'''%COUNT%'''</big>¦%COUNT%}², table =,Country,Area,Population,Text,#hits tablerow =style="text-align:right;"|%%,style="text-align:right;"|%%,style="background-color:lightyellow;"|<small>%%</small>,\n|style="text-align:right;"|%% </dpl> </nowiki></pre> * We select some African countries, we exclude Sudan * We acquire a piece of meta data about the articles we will find (in our case the usage counter) * We include two named parameters from a template call, <nowiki>{{Infobox Country or territory}}</nowiki> * We include a short text passage from the text before the first chapter * We use the third parameter of {{dpl3|format}} to output the usage counter (we could even highlight values above 100 here, for example) * We highlight usage values above 300 * We define a standard wiki table with the article name in the first column (named "Country") * We define column headers for transcluded contents and for the usage counter * We care for right alignment of the numerical values and define a bgcolor for the text
Summary:
Please note that all contributions to KB42 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
KB42:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
DONATE
Wiki tools
Wiki tools
Special Pages
Categories
Import Pages
Cargo data
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs