
NEW: Need to populate your table from a live database? Check out SuperTable Pro!
Abivia's SuperTable Plugin is designed to make your tabular data pop! SuperTable takes regular tabular data and turns it into a powerful and dynamic display.
SuperTable Features
SuperTable is a plugin, not a module. It doesn't have a fancy user interface, but you can create regular tables in your WYSIWYG editor and use SuperTable markup to create great results. it also means you can put a table in an article, in a module, anywhere.
SuperTable has some restrictions:
SuperTable runs when Joomla prepares an article for display, and just before the page is sent to the browser. This means you can use it anywhere you can put a table, in any component or module.
We'll start with a little information in a table, created in Joomla's default editor (TinyMCE). You can use any editor you want.
| Driver | Nationality | Team | Points |
| Sebastian Vettel | German | RBR-Renault | 374 |
| Jenson Button | British | McLaren-Mercedes | 240 |
| Fernando Alonso | Spanish | Ferrari | 227 |
| Mark Webber | Australian | RBR-Renault | 221 |
That's kind of boring! To start fixing it, put the Supertable markup around the table:
{supertable table}
HTML table
{/supertable}
This is what you get:
It's important to remember two things:
First, your table must be "valid XML". Usually this is pretty easy to achieve, but you might find some old code like this:
(we're using angle quotes for less than and greater than
because our editor insists on "fixing" our example.)
«img src="/pic.jpg" border=0»
Supertable will generate nothing if it sees code like that. A valid alternative is
«img src="/pic.jpg" border="0"/»
It's a good idea to make sure your code is valid anyway. Browsers do a much better job of displaying valid pages.
Second, you can't use multi-cell attributes, like colspan="2". SuperTable ignores these and you won't get the output you expect.
Our table is better, but SuperTable highlights columnar data and we have our data in rows. Most data is row based, and swapping data around is tedious. That's why SuperTable has a transpose function:
{supertable table transpose}
HTML table
{/supertable}
Now we have a column orientation:
A few things need to be fixed! The longer text has taken up two lines and pushed their columns down, and the headings don't stand out from the data. We also want the heading column to be narrower than the data columns. If we were Ferrari fans and wanted to highlight our team, we would make it the "active" column.
{supertable table transpose}
{active 3}
{headcols 1 15}
{headrows 1}
{rowheight 1 45px}
{rowheight 3 45px}
HTML table
{/supertable}
(all the SuperTable commands can be on one line if you prefer)
Now the table is starting to take shape:
That's just the basics of SuperTable. You can select from other built-in styles, specify your own CSS, and lots more. Check out the details tab to see everything SuperTable can do!
The plugin only has a few parameters:
| Parameter | Description | Default |
| Trigger Word | This is what the plugin looks for to start a table. | supertable |
| CSS Mode |
Where to get CSS for the table. Options are: No additional CSS - CSS is already included as part of the template. SuperTable preset - Use the style selected by the "CSS Template" parameter Custom - Use the styles provided in the file specified by the "Custom CSS File" parameter. |
SuperTable preset |
| CSS Template | This is a list of predefined styles. | ahs |
| Custom CSS File | This is a path to the custom CSS file. | (blank) |
| Debugging | Controls the output of diagnostic information. Diagnostics appear as HTML comments in the page. | Off |
The form of a SuperTable call is
{supertable table [options]}
[optional commands]
Your HTML table
{/supertable}
The commands are usually {command [options]}, but if a command conflicts with another plugin, you can add the trigger word so it becomes {supertable command [options]}
The HTML table can also contain these cell-level commands: class, link, style, subtext, target, and text. Commands are flagged with Cell and Table to indicate where they can be used.
The active command defines which column is highlighted when the user is not mousing over the table.
Formats:
{active column#}
{supertable active column#}
Example:
{active 3}
The borders command adds DIV tags to the output that surround the table and each column. This is intended to offer additional style options. The default value is off.
Formats:
{borders on|off}
{supertable borders on|off}
Example:
{borders on}
The class command adds a class identifier to the applicable HTML. When used at the table level, the outermost DIV has this class added. When used at the cell level, the DIV that contains the cell contents has this class added.
Formats:
{class name}
{supertable class name}
Example:
{class monochrome}
The clear command adds a clearing DIV after the table. If the value is zero, nothing is added.
Formats:
{clear number}
{supertable clear number}
Example:
{clear 1}
The CSS File command lets you include CSS for the table. Usually this would be used in conjunction with the class command or the id command to bring in table specific styles.
Formats:
{cssfile path}
{supertable cssfile path}
Example:
{cssfile path/to/file.css}
The header columns command defines how many table columns will have header styles applied to them. The optional second parameter defines the percentage of the table width that the header columns should take. If no width is specified the columns are distributed evenly.
Formats:
{headcols count [width]}
{supertable headcols count [width]}
Examples:
{headcols 1 12.5}
{headcols 2}
The header rows command defines the number of rows that will have header styles. If not present, no rows will be headers.
Formats:
{headrows number}
{supertable headrows number}
Example:
{headrows 1}
The id command sets a HTML id for the outer DIV of the table. This can be used to apply specific CSS rules.
Formats:
{id identifier}
{supertable id identifier}
Example:
{id special-table}
The link command turns text in the cell into a link and specifies the URL (also see the target command).
Formats:
{link url}
{supertable link url}
Example:
{link http://www.abivia.net/}
The row height command defines the height of a table row. This command can occur multiple times.
Formats:
{rowheight row# css-height}
{supertable rowheight row# css-height}
Examples:
{rowheight 1 45px}
{rowheight 5 3ex}
The style command allows you to add CSS to a specific table cell. In version 1.0.0 and higher, the style command works at the table level.
Formats:
{style css}
{supertable style css}
Example:
{style font-family:serif; font-size: 120%;}
Specifies text to be placed in a subtext span.
Formats:
{subtext any text}
{supertable subtext any text}
Example:
{subtext Daily Special!}
The target command defines the target attribute of any links in the cell (also see the link command).
Formats:
{target value}
{supertable target value}
Example:
{target _blank}
Normally the text value of a cell is the information that's left over after other commands have been removed. The link command allows you to specify the cell's text exactly.
Formats:
{text any text}
{supertable text any text}
Example:
{text Mark Webber}
.