Template:Shipwreck list begin/doc
{{Documentation subpage}}
A suite of three templates used to construct tables for the lists in {{cl|Lists of shipwrecks by year}}. The three templates are:
:{{tld|shipwreck list begin}} – creates table headings; one per table
:{{tld|shipwreck list item}} – table data; one template for each row
:{{tld|shipwreck list end}} – closes the table markup
Usage
=shipwreck list begin=
{{tld|shipwreck list begin}} is required for each table. The template takes two parameters, one of which is required:
:{{para|date}} – required; this parameter is used to create a table caption for those who use screen readers. The caption is not displayed but is present.
:{{para|sort}} - optional; set this parameter to y
to create a sortable table.
=shipwreck list item=
One or more {{tld|shipwreck list item}} template is required for each table. The template takes three parameters, none of which are required:
:{{para|ship}} – the wrecked ship's name; ship name styling per WP:NCSHIPS is the responsibility of the editor.
:{{para|country}} or {{para|flag}} – country, independent city, or navy to which the wrecked ship belonged; often uses a {{tlx|flag}} template.
:{{para|desc}} – a brief description of the wreck and/or its causes and consequences.
The parameter names for this template are not required except when the value includes '='. The positional order is:
:
=shipwreck list end=
{{tld|shipwreck list end}} is required for each table. The template takes no parameters. Because these tables are wrapped in {{tag|div}} tags, use this template instead of simply closing the table with |}
wiki markup so that the {{tag|div|c}} tag in properly included.
Examples
Typical use:{{efn|To help avoid Wikipedia's post expansion include size template limit, use {{tl|flagg}} with the appropriate additional parameters instead of {{tl|flag}}, {{tl|flag country}}, etc. on long pages or on templates that will be used on long pages.}}
{{shipwreck list begin |date=4 August 2014 |sort=}}
{{shipwreck list item
|ship= Diver Master
|flag={{flag|Denmark}}
|desc=The tug was sunk by {{ship||Kruzenshtern|ship|2}} ({{navy|Russia}}) at Esbjerg when a line between the two vessels failed to release. Her three crew were rescued.
}}
{{shipwreck list item
|ship= Pinak-6
|flag={{flag|Bangladesh|civil}}
|desc=The ferry, carrying approximately two hundred passengers, capsized on the Padma River in Munshiganj District, 30 km from Dhaka.
}}
{{shipwreck list item
|ship=Tahoe Queen
|flag={{flag|United States}}
|desc=The passenger ship ran aground off Tahoe Keys, California. Two hundred and ninety-six passengers were taken off the vessel in an operation coordinated by the United States Coast Guard.
}}
{{shipwreck list end}}
{{shipwreck list begin |date=4 August 2014 |sort=}}
{{shipwreck list item
|ship= Diver Master
|flag={{flag|Denmark}}
|desc=The tug was sunk by {{ship||Kruzenshtern|ship|2}} ({{navy|Russia}}) at Esbjerg when a line between the two vessels failed to release. Her three crew were rescued.
}}
{{shipwreck list item
|ship= Pinak-6
|flag={{flag|Bangladesh|civil}}
|desc=The ferry, carrying approximately two hundred passengers, capsized on the Padma River in Munshiganj District, 30 km from Dhaka.
}}
{{shipwreck list item
|ship=Tahoe Queen
|flag={{flag|United States}}
|desc=The passenger ship ran aground off Tahoe Keys, California. Two hundred and ninety-six passengers were taken off the vessel in an operation coordinated by the United States Coast Guard.
}}
{{shipwreck list end}}
When {{para|date}} is omitted or left blank in {{tld|shipwreck list begin}}:
{{shipwreck list begin |date= |sort=}}
{{shipwreck list item
|ship= Diver Master
|flag={{flag|Denmark}}
|desc=The tug was sunk by {{ship||Kruzenshtern|ship|2}} ({{navy|Russia}}) at Esbjerg when a line between the two vessels failed to release. Her three crew were rescued.
}}
{{shipwreck list item
|ship= Pinak-6
|flag={{flag|Bangladesh|civil}}
|desc=The ferry, carrying approximately two hundred passengers, capsized on the Padma River in Munshiganj District, 30 km from Dhaka.
}}
{{shipwreck list item
|ship=Tahoe Queen
|flag={{flag|United States}}
|desc=The passenger ship ran aground off Tahoe Keys, California. Two hundred and ninety-six passengers were taken off the vessel in an operation coordinated by the United States Coast Guard.
}}
{{shipwreck list end}}
To create a sortable list, set {{para|sort|y}}:
{{shipwreck list begin |date=4 August 2014 |sort=y}}
{{shipwreck list item
|ship= Diver Master
|flag={{flag|Denmark}}
|desc=The tug was sunk by {{ship||Kruzenshtern|ship|2}} ({{navy|Russia}}) at Esbjerg when a line between the two vessels failed to release. Her three crew were rescued.
}}
{{shipwreck list item
|ship= Pinak-6
|flag={{flag|Bangladesh|civil}}
|desc=The ferry, carrying approximately two hundred passengers, capsized on the Padma River in Munshiganj District, 30 km from Dhaka.
}}
{{shipwreck list item
|ship=Tahoe Queen
|flag={{flag|United States}}
|desc=The passenger ship ran aground off Tahoe Keys, California. Two hundred and ninety-six passengers were taken off the vessel in an operation coordinated by the United States Coast Guard.
}}
{{shipwreck list end}}
technical details
This table created by these templates is wrapped in {{tag|div|params=style="overflow-x:auto"}} tags so that images may coexist along the right edge of the page without an unwarranted amount white space in the page.
This template includes a table caption (
using wikimarkup; {{tag|caption}} using html markup) for accessibility. The caption is hidden from sighted readers by setting the element's opacity to 0. Because the caption is still present but hidden, the excess blank space between the bottom of the preceding text and the top of the TOC table is reduced by setting the table's top margin to -1.5em
.