From 0eee5ad0f108e089611b1d490b064371c6fcf8e5 Mon Sep 17 00:00:00 2001 From: George Hartzell Date: Tue, 14 Feb 2017 11:23:56 -0800 Subject: [PATCH] Wordsmith the prose --- pages/mydoc/mydoc_tables.md | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/pages/mydoc/mydoc_tables.md b/pages/mydoc/mydoc_tables.md index 90c35a2..98b4d25 100644 --- a/pages/mydoc/mydoc_tables.md +++ b/pages/mydoc/mydoc_tables.md @@ -87,31 +87,17 @@ If you need a more sophisticated table syntax, use HTML syntax for the table. Al -## jQuery datables +## jQuery DataTables -You also have the option of using a [jQuery datatable](https://www.datatables.net/), which gives you some more options. If you want to use a jQuery datatable, then add `datatable: true` in a page's frontmatter. This will load the right jQuery datatable scripts for the table on that page only (rather than loading the scripts on every page of the site.) +You also have the option of using a [jQuery DataTable](https://www.datatables.net/), which gives you some additional capabilities. To use a jQuery DataTable in a page, include `datatable: true` in a page's frontmatter. This tells the default layout to load the necessary CSS and javascript bits and to include a `$(document).ready()` function that initializes the DataTables library. -Also, you need to add this script to trigger the jQuery table on your page: +You can change the options used to initialize the DataTables library by editing the call to `$('table.display').DataTable()` in the default layout. The available options for Datatables are described in the [DataTable documentation](https://www.datatables.net/manual/options), which is excellent. -```js - -``` +You can also add page-specific triggers (by copying the `` block from the default layout into the page) and classes, which lets you use different options on different tables. -The available options for the datable are described in the [datatable documentation](https://www.datatables.net/manual/options), which is excellent. - -Additionally, you must add a class of `display` to your tables. (You can change the class, but then you'll need to change the trigger above from `table.display` to whatever class you want to you. You might have different triggers with different options for different tables.) - -Since Markdown doesn't allow you to add classes to tables, you'll need to use HTML for any datatables. Here's an example: +Markdown doesn't allow you to add classes to tables, so you'll need to use HTML for any DataTables. Here's an example: ```html @@ -205,7 +191,7 @@ Notice a few features: * You can sort the column order. * You can page the results so that you show only a certain number of values on the first page and then require users to click next to see more entries. -Read more of the [datatable documentation](https://www.datatables.net/manual/options) to get a sense of the options you can configure. You should probably only use datatables when you have long, massive tables full of information. +Read more of the [DataTable documentation](https://www.datatables.net/manual/options) to get a sense of the options you can configure. You should probably only use DataTables when you have long, massive tables full of information. {% include note.html content=" Try to keep the columns to 3 or 4 columns only. If you add 5+ columns, your table may create horizontal scrolling with the theme. Additionally, keep the column heading titles short." %}