-
Notifications
You must be signed in to change notification settings - Fork 13
Multiple tables
Version 1.8 includes the possibility to display multiple tables with each a different set of statistics.
In config.yml
,
the tables
field is a list of table configurations, each item specifies a table.
You can set a table's name, which columns get displayed, by which column to sort
and in which direction to sort (all of which are optional). You can add as many
tables as you want.
For more information, see the Config file wiki page.
If you use the built-in web server, you're done! All tables will be displayed automatically. When using your own index.html, though, let's continue with a bit more setup.
There are two ways to set up multiple tables in your own index.html.
-
Single parent element
The first option is to add a single<div>
to your page which WebStats will automatically populate with the appropriate tables. For this option, specifytableParent
in the web configuration as shown in the example index.html. -
Manually add
<table>
elements
Alternatively, if you want to control where each table appears on your page, you can add a<table>
element for each table yourself. Give them an id so you can find them withgetElementById
.In the web configuration, instead of specifying
tableParent
, addtables
. Thetables
field is an object where the keys are names of tables as specified in Set up table contents. The values are again objects that contain atable
field (the<table>
element) and apagination
field (the element containing WebStats pagination controls as in the example index.html).Also see the web configuration in the example index.html.