Template talk:PrettyXHTMLtable

From GTAMods Wiki
Revision as of 13:15, 6 March 2006 by Cerbera (talk | contribs) (Explaination of problems being encountered)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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)