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!
=== Other width methods === {{hatnote|'''Note:''' Fixed widths are not recommended for tables. Max-width is better. See previous section}} To force initial column widths to specific requirements, rather than accepting the width of the widest text element in a column's cells, follow this example. Note that [[Word wrap|wrap-around of text]] is forced for columns where the width requires it. Do not use <code>min-width:Xpx;</code> <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- ! scope="col" style="width: 50px;" | Name ! scope="col" style="width: 250px;" | Effect ! scope="col" style="width: 350px;" | Games found in |- | Poké Ball || Regular Poké Ball || All versions |- | Great Ball || Better than a Poké Ball || All versions |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- ! scope="col" style="width: 50px;" | Name ! scope="col" style="width: 250px;" | Effect ! scope="col" style="width: 350px;" | Games found in |- |Poké Ball || Regular Poké Ball || All versions |- |Great Ball || Better than a Poké Ball || All versions |} </div> To set column widths in a table without headers, specify the width in the first cell for each column. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- | style="width: 100pt;" | This column is 100 points wide | style="width: 200pt;" | This column is 200 points wide | style="width: 250pt;" | This column is 250 points wide |- | blah || blih || bluh |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- | style="width: 100pt;" | This column is 100 points wide | style="width: 200pt;" | This column is 200 points wide | style="width: 250pt;" | This column is 250 points wide |- | blah || blih || bluh |} </div> You can also use percentages, such as <code>style="width: 50%;"</code> to equalize the widths of a two-column table. One application of setting the widths is aligning columns of consecutive tables. The following are separate tables, with columns set to 350px and 225px. <div class="box"> '''Wikitext''' <syntaxhighlight lang=wikitext> {| class=wikitable |- ! scope=col style="width: 350px;" | Country ! scope=col style="width: 225px;" | Capital |- | Netherlands || Amsterdam |} {| class=wikitable |- ! scope=col style="width: 350px;" | Country ! scope=col style="width: 225px;" | Capital |- | France || Paris |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class=wikitable |- ! scope=col style="width: 350px;" | Country ! scope=col style="width: 250px;" | Capital |- | Netherlands || Amsterdam |} {| class=wikitable |- ! scope=col style="width: 350px;" | Country ! scope=col style="width: 250px;" | Capital |- | France || Paris |} </div>
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)