Help:Tables: Difference between revisions

From Destinypedia, the Destiny wiki

(Adapted from halopedia:Help:Tables)
 
m (Text replacement - "[[w:" to "[[wikipedia:")
Line 579: Line 579:
   4.321
   4.321
==Style classes==
==Style classes==
Some users have created [[w:CSS|CSS]] classes and [[Help:templates|templates]] to make table styles easier.  Instead of remembering table parameters, you just include an appropriate style class after the <code>{|</code>.  This helps keep table formatting consistent, and can allow a single change to the class to fix a problem or enhance the look of all the tables that are using it at once.  For instance, this:
Some users have created [[wikipedia:CSS|CSS]] classes and [[Help:templates|templates]] to make table styles easier.  Instead of remembering table parameters, you just include an appropriate style class after the <code>{|</code>.  This helps keep table formatting consistent, and can allow a single change to the class to fix a problem or enhance the look of all the tables that are using it at once.  For instance, this:
<table border="0" align="center"><tr><td width="46%">
<table border="0" align="center"><tr><td width="46%">
<blockquote style="background: white; border: 1px solid rgb(153, 153, 153); padding: 1em;"><pre><nowiki>
<blockquote style="background: white; border: 1px solid rgb(153, 153, 153); padding: 1em;"><pre><nowiki>
Line 673: Line 673:
|}
|}
</blockquote></td></tr></table>
</blockquote></td></tr></table>
simply by replacing the parameters of the table (<code>border="1" cellpadding="2"</code> or the like) with <code><nowiki>class="wikitable"</nowiki></code>  This is because the ''wikitable'' class in [[Wikipedia:MediaWiki:Common.css|MediaWiki:Common.css]] contains a number of ''table.wikitable'' [[w:CSS|CSS]] style rules.  These are all applied at once when you mark a table with the class.  You can then add additional style rules if desired.  These override the class's rules, allowing you to use the class style as a base and build up on it:
simply by replacing the parameters of the table (<code>border="1" cellpadding="2"</code> or the like) with <code><nowiki>class="wikitable"</nowiki></code>  This is because the ''wikitable'' class in [[Wikipedia:MediaWiki:Common.css|MediaWiki:Common.css]] contains a number of ''table.wikitable'' [[wikipedia:CSS|CSS]] style rules.  These are all applied at once when you mark a table with the class.  You can then add additional style rules if desired.  These override the class's rules, allowing you to use the class style as a base and build up on it:
==== Wiki markup ====
==== Wiki markup ====
<blockquote style="background: white; border: 1px solid rgb(153, 153, 153); padding: 1em;"><pre><nowiki>
<blockquote style="background: white; border: 1px solid rgb(153, 153, 153); padding: 1em;"><pre><nowiki>