Datatables are used to show a grid of textual data in a way that can be sorted and searched. Below is an example of how a datatable would appear on a page:
Step 1: Wire up the datatable block and format
- Go to the folder that has the page that needs a datatable.
- On the top menu select Add Content > _Responsive > Datatable and view the options in that block. The default options are usually what most people need. Save it in your folder
- Wire the newly-created datatable-settings block to the region in which you want your datatable to appear.
- Wire _shared-formats/tables/datatable format to that region
Step 2: Add rows and/or columns to the datatable
Edit the region to which you wired the datatable, it should appear like the table below in the "Table HTML Code" field. You can add/remove columns and rows by clicking on a cell and selecting an action from the table's pop-up.
If you have an existing table, you can click the Source Code icon (<>) and delete everything that you see, then copy your table's HTML. If you need help with this, please contact digitalmarketing@jmu.edu
Also, if you have a regular table on the same page as a datatable, you will want to add a class of "plaintable" so it does not get processed by the datatable javascript.