Example one:
- This example is using the tableSorter plugin written by Christian Bach!
- After sorting is completed, the table is grouped using the column which was used to sort the rows.
- The CSS class "mygroup" is set to the inserted rows.
- When sorted after the first column, only the first character is used for grouping.
- When sorted after the second or third column, all the text in the column is used for grouping.
//group on first column
$(this).tableGroup({groupColumn: 1, groupClass: 'mygroups', useNumChars: 1});
//group on second column
$(this).tableGroup({groupColumn: 2, groupClass: 'mygroups', useNumChars: 0});
//group on third column
$(this).tableGroup({groupColumn: 3, groupClass: 'mygroups', useNumChars: 0});
| Songname | Artist | Album |
| Silver Atom | Al | Arm |
| Gold Atom | Al | Arm |
| Cyan Street | Bill | Window |
| Brown Tree | John | Land |
| Red Tree | John | Land |
| Lime Cloud | John | Sky |
| Aqua Cloud | John | Sky |
| Blue Moon | Paul(son) | Sheep |
| Black Moon | Paul(son) | Sheep |
| Gray Sun | Paul(son) | Fly |
| Yellow Car | Paul(man) | Chair |
| Green Car | Paul(man) | Chair |
| White Horse | Tom | Stick |