Category:Collapsible box templates

From Cannabis
Jump to navigation Jump to search

Expand/collapse (or show/hide) table format:

Header text
Text, etc.
More text.
{| class="wikitable mw-collapsible mw-collapsed"  border=1 rules=all
! style=text-align:left; | Header text
|-
| Text, etc.
|-
| More text.
|}

! style=text-align:left; | Header text

This is needed. Otherwise the header text can go offscreen to the right for wide tables in narrow screens.

border=1 rules=all

or

border=1 cellpadding=4 rules=all 

Neither are required. But they are helpful when tables are copied and pasted into email, web pages, etc.. They keep cell borders and padding for all cells in the table.

You can override colors with this inline styling in the header wikitext:

  • !style="background-color:xxxxx; color:yyyyy;" |

Substitute color names or values for xxxxx and yyyyy. You can choose colors from these lists:

When using inline CSS to set header background color use this

  • style="background-color:xxxxx;"

instead of

  • style="background:xxxxx;"

Otherwise sorting in sortable tables may be broken. See Wikipedia:Help:Sorting, and bug 31755.

For more info see:

style="background-color:white;"

This is needed for some templates that expand into the gray space on the right side when the screen is narrow. For example; this template: