Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Table
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Borders === '''''Note:''' [[Wikipedia:HTML 5#Table attributes]]. CSS to replace obsolete attributes for borders, padding, spacing, etc.'' Add a border around a table using the CSS property <code>border: ''thickness style color'';</code>, for example <code>border:3px dashed red</code>. This example uses a solid (non-dashed) gray border that is one pixel wide: <div class="box" style="max-width:25em;"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| style="border-spacing: 2px; border: 1px solid darkgray;" ! style="width: 140px;" | Left ! style="width: 150px;" | Center ! style="width: 130px;" | Right |- | [[File:Starred.svg |120px| center]] | [[File:Star full.svg |120px| center]] | [[File:Stargreen.svg |120px| center]] |- style="text-align: center;" |Red star || Orange star || Green star |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| style="border-spacing: 2px; border: 1px solid darkgray;" ! style="width: 140px;" | Left ! style="width: 150px;" | Center ! style="width: 130px;" | Right |- | [[File:Starred.svg |120px| center]] | [[File:Star full.svg |120px| center]] | [[File:Stargreen.svg |120px| center]] |- style="text-align: center;" |Red star || Orange star || Green star |} </div> Note the bottom-row texts are centered by <code>style="text-align: center;"</code> to match the centering of the stars in their cells. As long as the <code>File:</code> specs omit the parameter <code>|thumb</code> they don't show the caption lines in the table (only during mouse-over). The border color <code>darkgray</code> matches typical tables or infoboxes in articles; however, it could be any color name (as in <code>style="border: 1px solid darkgreen;"</code>) or use a [[Hex triplet|hex-color]] (such as: <code>#DDCCBB</code>).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)