Description
A number of macros that produce or modify tables share common capabilities. This page documents the behavior and parameters for these capabilities. A JavaScript enabled browser is required to enable most of these capabilities.
Capabilities
- Column sorting - sort a column by clicking on column heading. Clicking again will reverse the order.
- Data specific sorting - see columnTypes parameter
- Column selection - hide columns
- Auto sort column
- Auto numbering of rows - ability to automatically add a leading column with the data row count.
- Auto total of numeric columns
- Row highlighting on mouse over - row is highlighted when mouse goes over any row element for non-heading rows
- Column attributes - ability to set the display attributes (color, font) on a column basis
- Table attributes - set table class, table style, and row styles - How to control table display characteristics
Overview
The following parameters are part of our common table capabilities that are available to many macros that produce or modify tables.
Click a column heading to toggle the sorting of that column.
Advanced date sorting
The default date handling (using the D column type) provides support for the browser default date format. This may not
work properly for tables that have date format that are different than the default format set for individual browsers. More advanced and automatic capabilities are possible by installing a specific date handling library. Documentation and source for the library can be found at JavaScript Toolbox. Install the date.js file on your Confluence server in .../includes/js directory.
Once the date library is installed, the D column type will now match successfully on many different date formats. Alternatively, setting a column type of D followed by a valid date format. Note that date formats that contain a comma (,), must be enclosed in a double quote.
Date examples:
Column type | Example date |
---|---|
DMM/dd/yyyy | 01/08/2007 |
D"MMM d, yyyy" | Jan 8, 2008 |
D | Many popular date formats |
Note that the date library is in English for date formats that include characters. It is possible to easily modify the date library for other languages before installing it on your server.
Examples
{table-plus:columnTypes=S,-,.|autoNumber=true|sortColumn=3 |columnAttributes=style="text-align:center;", ,style="background:yellow; font-size:14pt;"} || Name || Phone || TCP || | John | 555-1234 | 192.168.1.10 | | Mary Lou | 555-2134 | 192.168.1.12 | | Bob | 555-4527 | 192.168.1.9 | {table-plus}
which renders as:
Name |
Phone |
TCP |
---|---|---|
John |
555-1234 |
192.168.1.10 |
Mary Lou |
555-2134 |
192.168.1.12 |
Bob |
555-4527 |
192.168.1.9 |