Editing
Template:Anchor/doc
(section)
Jump to navigation
Jump to search
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!
=== Use in tables === Anchors may be used within tables, subject to certain restrictions. The {{tlx|anchor}} template may be used in the caption and cells of a table, but not those portions of a table that are outside the caption and cells. It is used on the table's caption thus:<syntaxhighlight lang=text>|+ {{anchor|FooX}} A table caption</syntaxhighlight> and the following forms of cell are valid:<syntaxhighlight lang=text>!{{anchor|Foo1}} A header cell !style="background:white;" |{{anchor|Foo2}} A header cell with styling |{{anchor|Foo3}} A data cell |rowspan=2 |{{anchor|Foo4}} A data cell spanning two rows</syntaxhighlight> You need to ensure that the {{tlx|anchor}} is not in that portion of the markup intended for the classes, styles etc. Thus, {{tlx|anchor}} cannot be placed anywhere on lines that begin with <code><nowiki>{|</nowiki></code> (start of table) or <code><nowiki>|-</nowiki></code> (new row), and the following forms of cell are not valid:<syntaxhighlight lang=text>!{{anchor|Foo1}} |A header cell !style="background:white;" {{anchor|Foo2}} |A header cell with styling |{{anchor|Foo3}} |A data cell |rowspan=2 {{anchor|Foo4}} |A data cell spanning two rows</syntaxhighlight> If it is necessary for an anchor to be in any of these positions, a different technique is used—the <code>id=</code> attribute. This is placed in that portion of the markup where the classes, styles etc. may be used, as follows:<syntaxhighlight lang=text>{| id=FooX class=wikitable |- id=FooY !id=Foo1 |A header cell !style="background:white;" id=Foo2 |A header cell with styling |id=Foo3 |A data cell |rowspan=2 id=Foo4 |A data cell spanning two rows</syntaxhighlight> The <code>id=</code> attribute may appear before, between or after any other attributes that may be present, but only one <code>id=</code> attribute may be used in each of these areas.
Summary:
Please note that all contributions to Meta Wiki 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
Meta Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Dark mode
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit
View history
More
Purge
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information
Get shortened URL