Difference between revisions of "Template talk:PrettyXHTMLtable"

From GTAMods Wiki
Jump to navigation Jump to search
m (Requesting help, since MediaWiki keeps screwing it up.)
m (Explaination of problems being encountered)
 
Line 41: Line 41:
  
 
== Comments ==
 
== Comments ==
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)
+
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)