Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Usage  





2 Examples  





3 See also  














Template:Row numbers






العربية

Català
فارسی
Français
Македонски

Oʻzbekcha / ўзбекча
Simple English
کوردی
Srpskohrvatski / српскохрватски

Türkçe
Українська
اردو
Tiếng Vit

 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 


This is a stop-gap template that serves as an interface to Module:Row numbers.

This template makes it possible, in many cases, to have an incrementing row indexer/counter in a table so that adding or removing rows automatically adjusts the numbering of subsequent rows. This template will become obsolete if and when MediaWiki supports automatically adding row numbers via WikiTable syntax. See Phab: T42618 - "jquery.tablesorter: Add support for a 'fixed' column of row numbers." And see Help:Sortable tables, and the sections on row numbering and auto-ranking. Using Template:Row numbers is one of the methods described on that page.

Usage

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

TemplateData for Row numbers

{{row numbers|wikitable|index = }}
The wikitable1

Either the whole wiki table surrounded by <nowiki>...</nowiki> tags, or the first section, when split by | characters

Starting indexindex

Starting index of row count which is useful when table is split by headings.
See List of highest-funded crowdfunding projects

Default
1
Example
50

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
The wikitable1

Either the whole wiki table surrounded by <nowiki>...</nowiki> tags, or the first section, when split by | characters

Stringrequired
Starting indexindex

Starting index of row count which is useful when table is split by headings. See https://en.wikipedia.org/w/index.php?title=List_of_highest-funded_crowdfunding_projects&oldid=1018568495

Default
1
Example
50
Numberoptional

This template takes an arbitrary number of parameters: the table and the starting index. There is a caveat: the table is wrapped in the template without escaping the | characters. The module is capable of dealing with this, but it is not capable of dealing with bare equals signs in the table syntax at the same time. As such, bare equals signs must be escaped with {{=}}:

{| class{{=}}"wikitable"
|-
! scope{{=}}col |...

Internally, the Module maintains a monotonically increasing counter. The Module looks for the keywords _row_count and _row_count_hold in the table. Keyword _row_count is replaced with the next counter value; keyword _row_count_hold is replaced with the value from the last _row_count replacement.

Examples

Examples
Visual effect Markup
Test incrementor
Count Text
1 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
2 Lorem ipsum dolor sit amet,
3 Lorem
3 Lorem ipsum
5 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
{{Row numbers|
{| class{{=}}"wikitable"
|+ Test incrementor
! Count !! Text
|-
|_row_count || {{Str left|{{Lorem ipsum span}}|123}}
|-
|_row_count || {{Str left|{{Lorem ipsum span}}|27}}
|-
|_row_count || {{Str left|{{Lorem ipsum span}}|5}}
|-
|_row_count_hold || {{Str left|{{Lorem ipsum span}}|11}}
|-
|_row_count || {{Str left|{{Lorem ipsum span}}|123}}
|}}}
Test incrementor
Count Text
50 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
51 Lorem ipsum dolor sit amet,
52 Lorem
52 Lorem ipsum
54 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
{{Row numbers|
{| class{{=}}"wikitable"
|+ Test incrementor
! Count !! Text
|-
|_row_count || {{Str left|{{Lorem ipsum span}}|123}}
|-
|_row_count || {{Str left|{{Lorem ipsum span}}|27}}
|-
|_row_count || {{Str left|{{Lorem ipsum span}}|5}}
|-
|_row_count_hold || {{Str left|{{Lorem ipsum span}}|11}}
|-
|_row_count || {{Str left|{{Lorem ipsum span}}|123}}
|} |index =50}}

See also

TemplateStyles for tables:


Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Row_numbers&oldid=1145735661"

Categories: 
Lua-based templates
Table templates
Hidden categories: 
Wikipedia semi-protected templates
Templates using TemplateData
 



This page was last edited on 20 March 2023, at 18:00 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki