Template:DefTable: Difference between revisions

From PWI Wiki
Jump to navigationJump to search
PWpedia>Sangodoc
More parameters
PWpedia>Sangodoc
More fixes
Line 1: Line 1:
style="background:{{{bkg|#171513}}}; padding: {{{padwid|2}}}px {{{padhgt|2}}}px; border: {{{bdrwid|1}}}px {{{bdrparam|}}} {{{bdrcolor|#B2B2B2}}};" cellpadding="{{{cellpad|4}}}"<noinclude>
style="background:{{{bkg|#171513}}}; padding: {{{padwid|2}}}px {{{padhgt|2}}}px; border: {{{bdrwid|1}}}px {{{bdrparam|}}} {{{bdrcolor|#B2B2B2}}};" border="{{{cellbdrwid|1}}}" cellpadding="{{{cellpad|4}}}"<noinclude>




Line 9: Line 9:
:'''padwid''' - The width of the padding on the left and right sides of the table, defaults to '''2'''.
:'''padwid''' - The width of the padding on the left and right sides of the table, defaults to '''2'''.
:'''padhgt''' - The height of the padding on the top and bottom of the table, defaults to '''2'''.
:'''padhgt''' - The height of the padding on the top and bottom of the table, defaults to '''2'''.
:'''bdrwid''' - The width of the line around the table, defaults to '''1'''.
:'''bdrwid''' - The width of the line around the outside of the table, defaults to '''1'''.
:'''bdrcolor''' - The color of the line around the table, defaults to '''#B2B2B2'''.
:'''bdrcolor''' - The color of the line around the table, defaults to '''#B2B2B2'''.
:'''bdrparam''' - Used for other border parameters, such as '''solid''', defaults to nothing.
:'''bdrparam''' - Used for other border parameters, such as '''solid''', defaults to nothing.
:'''cellbdrwid''' - The width of the line around each cell inside the table, defaults to '''1'''.
:'''cellpad''' - The amount of padding between the text and the sides of the table, defaults to '''4'''.
:'''cellpad''' - The amount of padding between the text and the sides of the table, defaults to '''4'''.


Line 46: Line 47:
Or it can be used with parameters like this:
Or it can be used with parameters like this:


  {<nowiki>| {{DefTable|bkg=#000000|bdrwid=0|cellpad=10}}</nowiki>
  {<nowiki>| {{DefTable|bkg=#000000|bdrwid=1|bdrparam=solid|padwid=0|padhgt=0|cellpad=10}} cellspacing="0"</nowiki>
  |+ <nowiki>'''Example Table'''</nowiki>
  |+ <nowiki>'''Example Table'''</nowiki>
  |-
  |-
Line 61: Line 62:
Which produces the following table:
Which produces the following table:


{| {{DefTable|bkg=#000000|bdrwid=0|bdrparam=solid|cellpad=10}}
{| {{DefTable|bkg=#000000|bdrwid=1|bdrparam=solid|padwid=0|padhgt=0|cellpad=10}} cellspacing="0"
|+ '''Example Table'''
|+ '''Example Table'''
|-
|-

Revision as of 16:36, 3 November 2012

style="background:#171513; padding: 2px 2px; border: 1px #B2B2B2;" border="1" cellpadding="4"



This is a default table header (deftable) for use in standard tables to provide a uniform look and to make it easier to update all/most tables simultaneously should the wiki's style (CSS) be updated again.

The DefTable template supports the following parameters:

bkg - The table's background color, defaults to #171513.
padwid - The width of the padding on the left and right sides of the table, defaults to 2.
padhgt - The height of the padding on the top and bottom of the table, defaults to 2.
bdrwid - The width of the line around the outside of the table, defaults to 1.
bdrcolor - The color of the line around the table, defaults to #B2B2B2.
bdrparam - Used for other border parameters, such as solid, defaults to nothing.
cellbdrwid - The width of the line around each cell inside the table, defaults to 1.
cellpad - The amount of padding between the text and the sides of the table, defaults to 4.

This template can be used as in the following example:

{| {{DefTable}}
|+ '''Example Table'''
|-
! Column
! Headers
|-
! Row 1
| Example A
|-
! Row 2
| Example B
|}

Which produces the following table:

Example Table
Column Headers
Row 1 Example A
Row 2 Example B

Or it can be used with parameters like this:

{| {{DefTable|bkg=#000000|bdrwid=1|bdrparam=solid|padwid=0|padhgt=0|cellpad=10}} cellspacing="0"
|+ '''Example Table'''
|-
! Column
! Headers
|-
! Row 1
| Example A
|-
! Row 2
| Example B
|}

Which produces the following table:

Example Table
Column Headers
Row 1 Example A
Row 2 Example B