Template:Userboxtop/testcases

{{Testcases}}

{{test case nowiki

| format = columns

| collapsible = yes

| showcode = yes

| title = Just title text

| code = {{__TEMPLATENAME__|Text of the title}}

{{User NPOV}}{{User edit war positive}}{{User wikipedia/No personal attacks}}{{User signs posts}}{{User t|3|c}}{{User css-2}}{{User js-2}}{{User xml-2}}{{User php-2}}{{User HTML-2}}{{User web archive}}{{User:Technical_13/Userboxes/BinaryPeople}}

{{Userboxbottom}}

}}

{{test case nowiki

| format = columns

| collapsible = yes

| showcode = yes

| title = Colors

|{{__TEMPLATENAME__|Colors|bordercolor=green|backgroundcolor=cyan|textcolor=maroon}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

}}

{{test case nowiki

| collapsible = yes

| showcode = yes

| title = Left aligned

|{{__TEMPLATENAME__|Should be left aligned|align=left}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

}}

{{test case nowiki

| collapsible = yes

| showcode = yes

| title = Center aligned

|{{__TEMPLATENAME__|Should be center aligned|align=center}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

}}

{{test case nowiki

| format = columns

| collapsible = yes

| showcode = yes

| title = Extra CSS

|{{__TEMPLATENAME__|With extra CSS|extra-css=border-style:dashed; border-width: 5px; text-decoration: overline wavy;}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

}}

{{test case nowiki

| format = columns

| collapsible = yes

| showcode = yes

| title = {{para|toptextstyle}}

|{{__TEMPLATENAME__|toptext=Foobar Xyzzy|toptextstyle=font-family: Times, serif; font-size: 200%;}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

}}

{{test case nowiki

| format = columns

| collapsible = yes

| showcode = yes

| title = Extra CSS to try to align the box in the center of the page (doesn't work because of margin-left handling)

|{{__TEMPLATENAME__|With extra CSS|extra-css=margin:auto;|float=none}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

}}

Code to center a table of userboxes

The template's handling of margin-left appears to prevent centering. There may be a workaround aside from this manual code.

{| role="presentation" class="userboxes" style="margin-bottom: 0.5em; width: 248px; border: #99B3FF solid 1px; background-color: #FFFFFF; color: #000000; float: none; margin:auto;"

|

Userboxes

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

=Sandbox code to center a table of userboxes=

Sandbox no-align (default to right)

{{Userboxtop/sandbox}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

{{-}}

Sandbox align=right

{{Userboxtop/sandbox|align=right}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

{{-}}

Sandbox align=center (to output invalid float=center, which is ignored in favor of margin:auto)

{{Userboxtop/sandbox|align=center}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

{{-}}

Sandbox align=left

{{Userboxtop/sandbox|align=left}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

{{-}}

Sandbox align=none (to output the valid float=none)

{{Userboxtop/sandbox|align=none}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

{{-}}

Sandbox float=none

{{Userboxtop/sandbox|float=none}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

{{-}}

Sandbox align=middle

{{Userboxtop/sandbox|align=middle}}

{{User NPOV}}{{User signs posts}}

{{Userboxbottom}}

{{-}}