Difference between revisions of "Template talk:PrettyXHTMLtable"
(Providing usage instructions.) |
m (Explaination of problems being encountered) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
==Usage== | ==Usage== | ||
− | You can use the <nowiki>{{PrettyXHTMLtable}}</nowiki> template instead of typing out all the XHTML attributes every time. This template is for building tables using XHTML markup | + | You can use the <nowiki>{{PrettyXHTMLtable}}</nowiki> template instead of typing out all the XHTML attributes every time. This template is for building tables using XHTML markup: there is a different [[Template:Prettytable|template for MediaWiki coded tables]]. |
The following is the markup for a simple table: | The following is the markup for a simple table: | ||
− | <nowiki>{ | + | <nowiki><table {{PrettyXHTMLtable}}> |
− | + | <tr> | |
− | + | <th scope="col">Column 1</th> | |
− | + | <th scope="col">Column 2</th> | |
− | + | <th scope="col">Column 3</th> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>Value (1,1)</td> | |
− | + | <td>Value (1,2)</td> | |
− | + | <td>Value (1,3)</td> | |
− | + | </tr> | |
− | + | <tr> | |
− | + | <td>Value (2,1)</td> | |
+ | <td>Value (2,2)</td> | ||
+ | <td>Value (2,3)</td> | ||
+ | </tr> | ||
+ | </table></nowiki> | ||
The above code will turn into the following table when saved: | The above code will turn into the following table when saved: | ||
− | {{ | + | <table {{PrettyXHTMLtable}}> |
− | <tr> | + | <tr> |
− | <th>Column</th> | + | <th scope="col">Column 1</th> |
− | <th>Column</th> | + | <th scope="col">Column 2</th> |
− | <th>Column</th> | + | <th scope="col">Column 3</th> |
− | </tr> | + | </tr> |
− | <tr> | + | <tr> |
− | <td>Value</td> | + | <td>Value (1,1)</td> |
− | <td>Value</td> | + | <td>Value (1,2)</td> |
− | <td>Value</td> | + | <td>Value (1,3)</td> |
− | </tr> | + | </tr> |
− | <tr> | + | <tr> |
− | <td> | + | <td>Value (2,1)</td> |
− | <td> | + | <td>Value (2,2)</td> |
− | <td> | + | <td>Value (2,3)</td> |
− | </tr> | + | </tr> |
</table> | </table> | ||
== Comments == | == Comments == | ||
− | '' | + | Initially I tried generating the entire <code><nowiki><table></nowiki></code> tag from this template, hence it being seperate to the other one. However, MediaWiki closed the tag it created before the table rows started! I've now changed this to simply generate the attributes. Why doesn't this work? It should be adding the attributes into the <code><nowiki><table></nowiki></code> tag but it puts a couple of character entities there instead. --[[User:Cerbera|Cerbera]] 07:09, 6 Mar 2006 (Central Standard Time) |
Latest revision as of 13:15, 6 March 2006
Usage
You can use the {{PrettyXHTMLtable}} template instead of typing out all the XHTML attributes every time. This template is for building tables using XHTML markup: there is a different template for MediaWiki coded tables.
The following is the markup for a simple table:
<table {{PrettyXHTMLtable}}> <tr> <th scope="col">Column 1</th> <th scope="col">Column 2</th> <th scope="col">Column 3</th> </tr> <tr> <td>Value (1,1)</td> <td>Value (1,2)</td> <td>Value (1,3)</td> </tr> <tr> <td>Value (2,1)</td> <td>Value (2,2)</td> <td>Value (2,3)</td> </tr> </table>
The above code will turn into the following table when saved:
Column 1 | Column 2 | Column 3 |
---|---|---|
Value (1,1) | Value (1,2) | Value (1,3) |
Value (2,1) | Value (2,2) | Value (2,3) |
Comments
Initially I tried generating the entire <table>
tag from this template, hence it being seperate to the other one. However, MediaWiki closed the tag it created before the table rows started! I've now changed this to simply generate the attributes. Why doesn't this work? It should be adding the attributes into the <table>
tag but it puts a couple of character entities there instead. --Cerbera 07:09, 6 Mar 2006 (Central Standard Time)