Difference between revisions of "Template:Table"

From DDO Compendium
m
Line 4: Line 4:


The following are the templates needed to create wikiTables:
The following are the templates needed to create wikiTables:
*Template:Table_Header
*Template:TableHeader
*Template:Table_optHeader
*Template:TableOptHeader
*Template:Table_Row
*Template:TableRow
*Template:Table_optRow
*Template:TableOptRow
*Template:Table_Footer
*Template:TableFooter


== Template: Table_Header ==
== Template: TableHeader ==
* Include sortable=1 if you want to enable sorting the columns.  If the table does not need to be sorted, omit the line.
* Include sortable=1 if you want to enable sorting the columns.  If the table does not need to be sorted, omit the line.
* Include collapsible=1 if you want the allow the user to collapse the table.  If you don't want the table to be collapsible, omit the line.
* Include collapsible=1 if you want the allow the user to collapse the table.  If you don't want the table to be collapsible, omit the line.
Line 18: Line 18:
* caption=<enter a caption for the table>.  All tables should have a caption.  However is you choose to not have a caption, omit the line.
* caption=<enter a caption for the table>.  All tables should have a caption.  However is you choose to not have a caption, omit the line.


== Template: Table_optHeader ==
== Template: TableOptHeader ==
Nothing is required from you, it is used in the Table_Header template to accommodate columns beyond column 1
Nothing is required from you, it is used in the TableHeader template to accommodate columns beyond column 1


== Template: Table_Row ==
== Template: TableRow ==
Add cell content between the pipes (|).  No limit to the number of rows.
Add cell content between the pipes (|).  No limit to the number of rows.


== Template: Table_optRow ==
== Template: TableOptRow ==
Nothing is required from you, it is used in the Table_Row template to accommodate rows beyond row 1.
Nothing is required from you, it is used in the TableRow template to accommodate rows beyond row 1.


== Template: Table_Footer ==
== Template: TableFooter ==
It is a required template because it closes the table.  Nothing else it required for its use.
It is a required template because it closes the table.  Nothing else it required for its use.


Line 35: Line 35:


== Example ==
== Example ==
{{Template:Table_Header
{{Template:TableHeader
|sortable=1 <!-- if you want it to be sortable, otherwise leave this line out -->
|sortable=1 <!-- if you want it to be sortable, otherwise leave this line out -->
|collapsible=1 <!-- if you want it to be collapsible, otherwise leave this line out -->
|collapsible=1 <!-- if you want it to be collapsible, otherwise leave this line out -->
Line 49: Line 49:
|Column Heading 6 <!-- optional, you can leave this line out -->
|Column Heading 6 <!-- optional, you can leave this line out -->
}}
}}
{{Template:Table_Row|Row 1 Cell 1|Row 1 Cell 2|Row 1 Cell 3|Row 1 Cell 4|Row 1 Cell 5|Row 1 Cell 6}}
{{Template:TableRow|Row 1 Cell 1|Row 1 Cell 2|Row 1 Cell 3|Row 1 Cell 4|Row 1 Cell 5|Row 1 Cell 6}}
{{Template:Table_Row|Row 2 Cell 1|Row 2 Cell 2|Row 2 Cell 3|Row 2 Cell 4|Row 2 Cell 5|Row 2 Cell 6}}
{{Template:TableRow|Row 2 Cell 1|Row 2 Cell 2|Row 2 Cell 3|Row 2 Cell 4|Row 2 Cell 5|Row 2 Cell 6}}
{{Template:Table_Row|Row 3 Cell 1|Row 3 Cell 2|Row 3 Cell 3|Row 3 Cell 4|Row 3 Cell 5|Row 3 Cell 6}}
{{Template:TableRow|Row 3 Cell 1|Row 3 Cell 2|Row 3 Cell 3|Row 3 Cell 4|Row 3 Cell 5|Row 3 Cell 6}}
{{Template:Table_Row|Row 4 Cell 1|Row 4 Cell 2|Row 4 Cell 3|Row 4 Cell 4|Row 4 Cell 5|Row 4 Cell 6}}
{{Template:TableRow|Row 4 Cell 1|Row 4 Cell 2|Row 4 Cell 3|Row 4 Cell 4|Row 4 Cell 5|Row 4 Cell 6}}
{{Template:Table_Footer}}
{{Template:TableFooter}}


[[Category:Template]]
[[Category:Template]]

Revision as of 16:00, 27 April 2018

How To Use This Template[edit]

The following will create a 'wikitable' using the default .css.

The following are the templates needed to create wikiTables:

  • Template:TableHeader
  • Template:TableOptHeader
  • Template:TableRow
  • Template:TableOptRow
  • Template:TableFooter

Template: TableHeader[edit]

  • Include sortable=1 if you want to enable sorting the columns. If the table does not need to be sorted, omit the line.
  • Include collapsible=1 if you want the allow the user to collapse the table. If you don't want the table to be collapsible, omit the line.
  • Include collapsed=1 if you want the table collapsed when the page is loaded. If you don't want the table collapsed, omit the line.
  • Include center=1 if you want the columns centered. If you don't want the contents of the table centered, omit the line.
  • caption-style=text-align: left; width: 200px. This was added to ensure the caption, for a table that is collapsed, is presented on a single line. This line can be omitted.
  • caption=<enter a caption for the table>. All tables should have a caption. However is you choose to not have a caption, omit the line.

Template: TableOptHeader[edit]

Nothing is required from you, it is used in the TableHeader template to accommodate columns beyond column 1

Template: TableRow[edit]

Add cell content between the pipes (|). No limit to the number of rows.

Template: TableOptRow[edit]

Nothing is required from you, it is used in the TableRow template to accommodate rows beyond row 1.

Template: TableFooter[edit]

It is a required template because it closes the table. Nothing else it required for its use.

Notes[edit]

  • You must have at least one column heading. The template is able to accommodate up to 6 columns. Headings for columns 2 thru 6 are optional.
  • I've intentionally left out any formatting, except for the table caption, so the base .css file would be used.

Example[edit]

Table Caption
Column Heading 1 Column Heading 2 Column Heading 3 Column Heading 4 Column Heading 5 Column Heading 6
Row 1 Cell 1 Row 1 Cell 2


Row 1 Cell 3


Row 1 Cell 4


Row 1 Cell 5


Row 1 Cell 6


Row 2 Cell 1 Row 2 Cell 2


Row 2 Cell 3


Row 2 Cell 4


Row 2 Cell 5


Row 2 Cell 6


Row 3 Cell 1 Row 3 Cell 2


Row 3 Cell 3


Row 3 Cell 4


Row 3 Cell 5


Row 3 Cell 6


Row 4 Cell 1 Row 4 Cell 2


Row 4 Cell 3


Row 4 Cell 4


Row 4 Cell 5


Row 4 Cell 6