Sheets2Table uses shortcodes to customize the table.
- Click on the Shortcodes tab in the Sheets2Table plugin
- Locate the file associated with the Google Sheet data that you want to display. Click the Customize link.
- Select the columns to display. Press the Generate shortcode button.
- Copy the updated shortcode and add to a page or post
Manual shortcode edit
The shortcode customization tool provides a basic level of functionality. There is more that shortcodes offer.
Here is an empty shortcode:
[sheets2table-render-table csv_file="" columns="" titles="" options=""]
- sheets2table-render-table: This is the name of shortcode that is registered to the sheets2table plugin
- csv_file: The name of the CSV file to display
- columns: The exact name of the column in the CSV file/Google Sheet. Each column is separated by a comma.
- titles: The text displayed in the table generated by the shortcode
- options: Options such as responsive table and always get latest data
Modifying the shortcode
columns: Only the columns listed in the shortcode will be displayed. The columns will be displayed in the order they appear in the shortcode.
titles: The number of elements in the titles should match that in the columns. The text in the title field is what is displayed in the table header.
For the demo file of city temperature
(Google sheet ID
[sheets2table-render-table csv_file="average-daily-temp.csv" columns="Location, High (Jan), High (Apr), High (Jul), High (Oct)" titles="Location, High (Jan), High (Apr), High (Jul), High (Oct)" options=""]
[sheets2table-render-table csv_file="average-daily-temp.csv" columns="Location, High (Oct), High (Jul), High (Apr), High (Jan)" titles="Location, October, July, April, January" options=""]
Notice that that columns are in reverse order and the titles are chaged.