แม่แบบ:Row numbers/doc

จากวิกิพีเดีย สารานุกรมเสรี

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[แก้]

ด้านล่างนี้คือข้อมูลแม่แบบ เอกสารกำกับสำหรับแม่แบบนี้ซึ่งถูกใช้งานโดยเครื่องมือแก้ไขแบบเห็นภาพและเครื่องมืออื่น ๆ

ข้อมูลแม่แบบสำหรับ 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
ค่าปริยาย
1
ตัวอย่าง
50
จำนวนเลือกได้

Format: inline

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 lorem
1 แม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum span[[:แม่แบบ:L
2 [[:แม่แบบ:Lorem ipsum span]
3 [[:แม
3 [[:แม่แบบ:L
5 แม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum span[[:แม่แบบ:L
{{row numbers|
{| class{{=}}"wikitable"
|+test incrementor
!count !! lorem
|-
|_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 lorem
50 แม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum span[[:แม่แบบ:L
51 [[:แม่แบบ:Lorem ipsum span]
52 [[:แม
52 [[:แม่แบบ:L
54 แม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum spanแม่แบบ:Lorem ipsum span[[:แม่แบบ:L
{{row numbers|
{| class{{=}}"wikitable"
|+test incrementor
!count !! lorem
|-
|_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[แก้]

Template styles for tables:

  • {{sticky header}} - makes column headers stick to the top of the page while scrolling through table data.
  • {{sort under}} - moves the sorting arrows under the headers.
  • {{row hover highlight}} - adds row hover highlighting, and option for white background.