TableMaster User's Guide

Overview

Welcome to the TableMaster User's Guide. This guide describes how to use TableMaster and provides working examples using each keyword that you can tryout in your page or post. TableMaster was created because I needed to print a list of members contact information for a non-profit organization I was working for. The membership data was in a table in my Wordpress database, but there were no Wordpress plugins available that would print data directly from the Wordpress database. Therefore, TableMastert was built to solve that problem. TableMaster provides several options you can use to identify and extract the data you want to print from your database, and several options you can use to format the data into a nicely styled table on your page or post. All of these options are specified using keywords with the 'tablemaster' shortcode, and several of the keywords (which are denoted with the gear icon) can be set to a user-define default value from the General Options screen in the admin area by selecting the 'TableMaster' option from the Settings menu.

There are three basic steps to printing a table with TableMaster:

And, don't miss these extras at the end of the User's Guide:

Step 1: Specify the data to print

TableMaster is designed to extract data from a database table, and so it naturally needs to be able to accept and process a MySQL command. However, no knowledge of MySQL commands is necessary to use TableMaster. In it's simplest form, the only keyword you must provide with the tablemaster shortcode is the name of the database table (or view) that you want to print. But, you also have the option to provide a simple, or a very complex MySQL command to extract the data you want to print. This section describles the keywords you can use to extract the data from the database table.

table Keyword

Default Value: None

The table keyword is one of the keywords you can use to specify the data you would like to print by simply providing the name of the database table you want to print. This example will print all rows and all columns in the tm_example_table table. Note: the tm_example_table has 5 columns (Horse, Breed, Score, Test, Rider) and 7 rows.

Example: [tablemaster table="tm_example_table"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

view Keyword

Default Value: None

The view keyword is one of the keywords you can use to specify the data you would like to print by simply providing the name of the database table you want to print. This example will print all rows and all columns in the tm_example_view view. Note: the tm_example_view has only 4 of the columns (Horse, Breed, Rider, Score) from the tm_example_table and they columns are in a different order and 7 rows.

Example: [tablemaster view="tm_example_view"]

HorseBreedRiderScore
Cirque du SoleilDraft CrossAdult Amateur60.000
ZackaryThoroughbredOpen60.488
LinoFriesianAdult Amateur63.143
CinnamonOldenbergJR/YR59.450
ZackaryThoroughbredOpen56.143
LinoFriesianAdult Amateur68.387
StolichnayaHanoverianAdult Amateur56.379

columns Keyword

Default Value: None

The columns keyword allows you to select the columns from your database table (or view) that you would like to print. When the columns keyword is used with the table or view keywords, you must specify the names of the columns as a comma separated list with NO spaces after each comma, and the names must be specified exactly as they are specified in the actual database table or view. The example below will print 3 columns (Horse, Breed, Score) from the tm_example_view view. However, when the columns keyword is used with the sql keyword (described next), you must specify the names of the columns exactly as they will be returned by the query command that you provide (see the example in next section).

Example: [tablemaster view="tm_example_view" columns="Horse,Breed,Score"]

HorseBreedScore
Cirque du SoleilDraft Cross60.000
ZackaryThoroughbred60.488
LinoFriesian63.143
CinnamonOldenberg59.450
ZackaryThoroughbred56.143
LinoFriesian68.387
StolichnayaHanoverian56.379

sql Keyword

Default Value: None

The sql keyword allows you to specify any valid MySQL command to select the data from your database table (or view) that you would like to print. The sql keyword provides you with as much flexibility and/or complexity as you need in order to select the data. However, there is one thing you need to watch out for. The Wordpress visual editor will sometimes turn any < (less than), <= (less than or equal to), > (greater than), >= (greater than or equal to) sign into their equivalent HTML entities. And when that happens, your query command will be invalide. Therefore, TableMaster provides substitutions for these characters that you can use without having to worry about what the Visual Editor will do to your query command.

SymbolSubstitute
<__LT__
<=__LE__
>__GT__
>=__GE__
=__EQ__
<>__NE__

This example will print all rows in the tm_example_table where the Score value is greater than 59.

Example: [tablemaster sql="SELECT * from tm_example_table where Score __GT__ 59"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
LinoFriesian68.387First Level, Test 3 2011Adult Amateur

This example will print all rows in the tm_example_long_table that contain scores for the horse named Cirqu du Soleil.

Example: [tablemaster sql="SELECT * from tm_example_long_table where Horse __EQ__ 'Cirque du Soleil'"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur

While the columns keyword can be used with the sql keyword, using the columns keyword with the sql keyword is useful only in a situation where you need to include a specific column name in your query, but you don't actually want to print that column. This would be true, for example, if you were using the link_labels and link_targets keywords (described in the TableMaster Advanced Keywords section). But, here is a simple example to illustrate how the columns keyword could be used with the sql keyword. Note: 4 columns are selected by the query, but only 3 columns are printed, and the column names specified with the columns keyword are the column names as they would be returned by the query, rather than the actual names of the columns in the database table.

Example: [tablemaster sql="SELECT Horse as 'My Horse', Score as 'My Score', Rider, Test as 'My Test' FROM tm_example_table" columns="My Horse,My Score,My Test"]

My HorseMy ScoreMy Test
Cirque du Soleil60.000Training Level, Test 2 2011
Zackary60.488Third Level, Test 2 2011
Lino63.143Second Level, Test 1 2011
Cinnamon59.450Introductory Walk-Trot Test A 2011
Zackary56.143Fourth Level, Test 1 2011
Lino68.387First Level, Test 3 2011
Stolichnaya56.379First Level, Test 1 2011

Step 2: Add your own table styling

Most Wordpress themes come with their own default style for tables. But, if you want to change some aspect of the default style, or change the entire style completely, you can use the keywords in this section. The styles you see used in the remaining examples (and in the example styles section at the end of this guide) are defined in the tablemaster/css/tablemaster.css file. If you would like to customize any of these styles, you can do so by copying the tablemaster.css file and saving it in a 'css' subdirectory of your theme's folder, and then modifying it however you like.

class Keyword

Default Value: None

The class keyword allows you to specify the name of one or more CSS classes to be applied to the entire table. The value you specify with the class keyword will be inserted directly into the HTML <table> tag 'class' attribute. For example: <table class="black-header-gray-alternate-rows">.

Example: [tablemaster class="black-header-gray-alternate-rows" table="tm_example_table"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

thead Keyword

Default Value: "true"

The thead keyword allows you to enable or disable styling for the table header row. Essentially, if this keyword is true, the <thead></thead> HTML tags will be used for the first row of the table. And if your theme or your style supports styling the <thead></thead> HTML tags, then, a style will be applied to the header row. However, if your theme or style does not support styling the <thead></thead> HTML tags, then, a style will not be applied to the header row even if the thead keyword is set to true. If you want the first row of your table to be styled the same as the body of your table, then you should set the thead keyword to false as shown in the example below.

Example: [tablemaster thead="false" view="tm_example_view"]

HorseBreedRiderScore
Cirque du SoleilDraft CrossAdult Amateur60.000
ZackaryThoroughbredOpen60.488
LinoFriesianAdult Amateur63.143
CinnamonOldenbergJR/YR59.450
ZackaryThoroughbredOpen56.143
LinoFriesianAdult Amateur68.387
StolichnayaHanoverianAdult Amateur56.379

nohead Keyword

Default Value: "false"

The nohead keyword allows you to print a table without a header row. Note: the column names do not appear in the first row of this table.

Example: [tablemaster nohead="true" view="tm_example_view"]

Cirque du SoleilDraft CrossAdult Amateur60.000
ZackaryThoroughbredOpen60.488
LinoFriesianAdult Amateur63.143
CinnamonOldenbergJR/YR59.450
ZackaryThoroughbredOpen56.143
LinoFriesianAdult Amateur68.387
StolichnayaHanoverianAdult Amateur56.379

tfoot Keyword

Default Value: "false"

The tfoot keyword is similar to the thead except that it works on the last row of the table, and the default setting is false. If the tfoot keyword is true, the <tfoot></tfoot> HTML tags will be used for the last row of the table. And if your theme or your style supports styling the <tfoot></tfoot> HTML tags, then, a style will be applied to the last row. However, if your theme or style does not support styling the <tfoot></tfoot> HTML tags, then, a style will not be applied to the last row even if the tfoot keyword is set to true. If you want the last row of your table to be styled differently than the body of your table, then you should set the tfoot keyword to true as shown in the example below.

Example: [tablemaster tfoot="true" view="tm_example_view"]

HorseBreedRiderScore
Cirque du SoleilDraft CrossAdult Amateur60.000
ZackaryThoroughbredOpen60.488
LinoFriesianAdult Amateur63.143
CinnamonOldenbergJR/YR59.450
ZackaryThoroughbredOpen56.143
LinoFriesianAdult Amateur68.387
StolichnayaHanoverianAdult Amateur56.379

style Keyword

Default Value: None

The style keyword allows you to specify css style statements to apply to the entire table. The value you specify with the style keyword will be inserted directly into the HTML <table> tag 'style' attribute. For example: <table style="background-color:lightgray;">. The example below inserts a style statement that turns the background of the table to a light gray color.

Example: [tablemaster style="background-color:lightgray;" table="tm_example_table"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

css Keyword

Default Value: None

The style keyword allows you to insert css style statements directly into the HTML. The value specified here will be placed inside <style></style> tags directly before the HTML <table> tag. The example will insert a css style statement that all of the text to red.

Example: [tablemaster css="table#tablemaster_table_11.table tbody tr td {color: red;}" table="tm_example_table"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

col_widths Keyword

Default Value: None

The col_widths keyword allows you to control the relative width of each column. You can specify a percentage of the total width that each column should use. The percentages should be specified in comma separated list, in the column order, and without the '%' sign. The example below will set the first column to use 20% of the width of the table, the second column to use 20% of the width of the table, the third column to use 10% of the width of the table, and the 4th column to use 50% of the width of the table.

Example: [tablemaster col_widths="20,20,10,50" view="tm_example_view"]

HorseBreedRiderScore
Cirque du SoleilDraft CrossAdult Amateur60.000
ZackaryThoroughbredOpen60.488
LinoFriesianAdult Amateur63.143
CinnamonOldenbergJR/YR59.450
ZackaryThoroughbredOpen56.143
LinoFriesianAdult Amateur68.387
StolichnayaHanoverianAdult Amateur56.379

nowrap Keyword

Default Value: None

The nowrap keyword allows you to control whether or not the text in a column will break to a new line when the column's default width is not wide enough for the text. Referring to the example above, notice that the third column width is set to 10 percent, but the text in the column is broken into 2 lines in the rows that contain "Adult Amateur". The nowrap keyword can be used to prevent the text from wrapping to a new line. In the example below, the width of the third column is set to 10, but the nowrap keyword has forced the third column to be wide enough to hold the text without wrapping to a new line. If you wish to prevent more than one column from wrapping text to a new line, the column names must be specified as a comma separated list, with no spaces after the commas, and the names must match names that are printed in the header row, or match the names of the columns in the database if no header row is printed.

Example: [tablemaster nowrap="Rider" col_widths="20,20,10,50" view="tm_example_view"]

HorseBreedRiderScore
Cirque du SoleilDraft CrossAdult Amateur60.000
ZackaryThoroughbredOpen60.488
LinoFriesianAdult Amateur63.143
CinnamonOldenbergJR/YR59.450
ZackaryThoroughbredOpen56.143
LinoFriesianAdult Amateur68.387
StolichnayaHanoverianAdult Amateur56.379

Step 3: Add JQuery Datatables and Buttons

datatables Keyword

Default Value: "false"

The datatables keyword allows you to add the DataTables table plugin in jQuery to your table. DataTables is a very powerful jQuery plugin that adds functionality to sort and search for data, change the number of rows that are displayed and the ability to paginate through long tables. The datatables keyword requires the thead keyword to be set to true.

Example: [tablemaster datatables="true" table="tm_example_table"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

rows Keyword

Default Value: 10

The rows keyword allows you to change the default number of rows to be displayed by the DataTables table plugin in jQuery. Valid options are "10", "25", "50" and "100". The rows keyword requires the datatables keyword to be set to true.

Example: [tablemaster rows="25" datatables="true" table="tm_example_long_table"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

buttons Keyword

Default Value: "false"

The buttons keyword allows you to add the DataTables table plugin in jQuery 'Buttons' extension to your table. The 'Buttons' extension adds "Copy", "CSV", "Excel", "PDF" and "Print" buttons to your table that allow your users to copy the table or save the table in CSV, Excel, or PDF format, or Print the table. The buttons keyword requires the datatables keyword to be set to true.

Example: [tablemaster buttons="true" datatables="true" table="tm_example_table"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

button_list Keyword

Default Value: None

The button_list keyword allows you to change the default buttons that are added by the DataTables table plugin in jQuery 'Buttons' extension. The desired buttons must be a comma separated list containing one ore more of the following values: copy, excel, csv, pdf, print. The button_list keyword requires the buttons keyword to be set to true.

Example: [tablemaster datatables="true" buttons="true" tfoot="true" button_list="csv,pdf,print" table="tm_example_table"]

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

default_sort Keyword

Default Value: true

The default_sort keyword allows you to disable the default sorting algorithm used by the DataTables table plugin in jQuery. The default_sort keyword requires the datatables keyword to be set to true. If you are using the sql keyword with an ORDER BY clause, you should set the default_sort keyword to "false".

Example: [tablemaster default_sort="false" datatables="true" buttons="true" tfoot="true" button_list="csv,pdf,print" sql="SELECT * FROM tm_example_long_table ORDER BY Score ASC"]

HorseBreedScoreTestRider
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
LinoFriesian68.387First Level, Test 3 2011Adult Amateur

TableMaster Advanced Keywords

This section describes TableMaster keywords that have an uncommon or specialized purpose that do not fall into any of the categories described in Steps 1 to 3 above.

Default Value: None

The first in this category are the link_labels and link_targets keywords. These keywords are designed to work together to handle the case where you want one or more of your columns in your database table to be printed as hyper links. For example, you would like to print Codehorse Software in a table cell rather than print "http://codehorsesoftware.com" in a table cell. To do this, you will need to store the 'labels' for the links in one column, and the 'targets (i.e. the 'href') for your links in another column. Then, you can use the link_labels and link_targets keywords to control how those columns are printed.

Consider the following table 'tm_example_link_table' that contains 3 columns 'Column1', 'Column2' and 'Columns'. Column1 contains a 'label', Column2 contains a hyper link, and Column3 contains a description as shown.

Example: [tablemaster table="tm_example_link_table"]

Column1Column2Column3
Wordpress.orghttp://wordpress.org/This link will take you to the Wordpress.org website.
Homehttp://www.codehorsesoftware.com/This link will take you to the codehorsesoftware.com .
TableMasterhttp://www.codehorsesoftware.com/tablemaster-wordpress-plugin/This link will take you to the User's Guide web page.

Then, you can tell TableMaster to print Column1 as a link by adding the link_labels and link_targets keywords. The link_labels keyword tells TableMaster which column (or columns) contain the labels for the links, and the link_targets keyword tells TableMaster which column (or columns) contain the URL you want to link the label to as shown below.

Example: [tablemaster table="tm_example_link_table" link_labels="Column1" link_targets="Column2"]

Column1Column2Column3
Wordpress.orghttp://wordpress.org/This link will take you to the Wordpress.org website.
Homehttp://www.codehorsesoftware.com/This link will take you to the codehorsesoftware.com .
TableMasterhttp://www.codehorsesoftware.com/tablemaster-wordpress-plugin/This link will take you to the User's Guide web page.

But, now that Column1 is printed as a link, you probably don't need to print Column2 at all. Here's where the columns keyword comes in handy. You can use the columns keyword to tell TableMaster to print only columns Column1 and Column3 as shown below.

Example: [tablemaster table="tm_example_link_table" link_labels="Column1" link_targets="Column2" columns="Column1,Column3"]

Column1Column3
Wordpress.orgThis link will take you to the Wordpress.org website.
HomeThis link will take you to the codehorsesoftware.com .
TableMasterThis link will take you to the User's Guide web page.

And finally, the column names in this example are not very meaningful, so let's use the sql keyword to peform a query that returns more meaningful column names for this table.

Example: [tablemaster sql="SELECT Column1 as 'Link Label', Column2, Column3 as 'Link Description' FROM tm_example_link_table" link_labels="Link Label" link_targets="Column2" columns="Link Label,Link Description"]

Link LabelLink Description
Wordpress.orgThis link will take you to the Wordpress.org website.
HomeThis link will take you to the codehorsesoftware.com .
TableMasterThis link will take you to the User's Guide web page.

new_window Keyword

Default Value: "true"

The new_window keyword only applies when you are using the link_labels and link_targets keywords. The new_windowkeyword determines whether links are opened in a new browser window (or tab) or whether they are opened in the current window. The example below will open links in the current window.

Example: [tablemaster new_window="false" sql="SELECT Column1 as 'Link Label', Column2, Column3 as 'Link Description' FROM tm_example_link_table" link_labels="Link Label" link_targets="Column2" columns="Link Label,Link Description"]

Link LabelLink Description
Wordpress.orgThis link will take you to the Wordpress.org website.
HomeThis link will take you to the codehorsesoftware.com .
TableMasterThis link will take you to the User's Guide web page.

pre_table_filter Keyword

Default Value: None

The pre_table_filter keyword can be used to call a user-defined filter before the table is printed. In the example below, the user-defined filter calls a function that prints a company logo. A pre-table filter can be used to perform any user-defined processing prior to printing the table.

Example: [tablemaster pre_table_filter="my_filter_name" view="tm_example_view"]

HorseBreedRiderScore
Cirque du SoleilDraft CrossAdult Amateur60.000
ZackaryThoroughbredOpen60.488
LinoFriesianAdult Amateur63.143
CinnamonOldenbergJR/YR59.450
ZackaryThoroughbredOpen56.143
LinoFriesianAdult Amateur68.387
StolichnayaHanoverianAdult Amateur56.379

post_table_filter Keyword

Default Value: None

The post_table_filter keyword can be used to call a user-defined filter after the table is printed. In the example below, the user-defined filter calls a function that prints a company logo. A post-table filter can be used to perform any user-defined processing after the table is printed.

Example: [tablemaster post_table_filter="my_filter_name" view="tm_example_view"]

HorseBreedRiderScore
Cirque du SoleilDraft CrossAdult Amateur60.000
ZackaryThoroughbredOpen60.488
LinoFriesianAdult Amateur63.143
CinnamonOldenbergJR/YR59.450
ZackaryThoroughbredOpen56.143
LinoFriesianAdult Amateur68.387
StolichnayaHanoverianAdult Amateur56.379

Example Table Styles Provided with TableMaster

Below are samples of the styles provided in the tablemaster/css/tablemaster.css file.

black-header-gray-alternate-rows

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

blue-header-blue-alternate-rows

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

red-header-only

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

green-header-alternate-rows

HorseBreedScoreTestRider
Cirque du SoleilDraft Cross60.000Training Level, Test 2 2011Adult Amateur
ZackaryThoroughbred60.488Third Level, Test 2 2011Open
LinoFriesian63.143Second Level, Test 1 2011Adult Amateur
CinnamonOldenberg59.450Introductory Walk-Trot Test A 2011JR/YR
ZackaryThoroughbred56.143Fourth Level, Test 1 2011Open
LinoFriesian68.387First Level, Test 3 2011Adult Amateur
StolichnayaHanoverian56.379First Level, Test 1 2011Adult Amateur

Troubleshooting Tips

  • Be wary of the Wordpress Visual Editor. If you have a super strange problem where the MySQL command is failing, or a keyword is not being recognized, and you think you have specified all of the keywords properly, check the shortcode using the HTML/Text editor and make sure the Wordpress Visual Editor hasn't inserted text styling in the middle of the shortcode.