Skip to content

Commit e4e10c3

Browse files
Update readme to be less confusing.
1 parent ddb03e2 commit e4e10c3

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
![table-sort-js](https://img.shields.io/npm/v/table-sort-js)
2-
![table-sort-js](https://img.shields.io/npm/dw/table-sort-js)
2+
![table-sort-js](https://img.shields.io/npm/dm/table-sort-js)
33
![table-sort-js](https://img.shields.io/github/repo-size/leewannacott/table-sort-js)
44
![table-sort-js](https://img.shields.io/github/license/LeeWannacott/table-sort-js)
55
![table-sort-js](https://img.shields.io/github/workflow/status/leewannacott/table-sort-js/Jest%20CI%20-%20Automated%20testing%20of%20table%20sorting.?label=tests)
@@ -12,44 +12,41 @@
1212
- [Documentation.](https://leewannacott.github.io/table-sort-js/docs/about.html)
1313
(work in progress)
1414
- [npm package.](https://www.npmjs.com/package/table-sort-js)
15-
## Install instructions - pick one option.
15+
## Install instructions.
1616

17-
1. Install from npm: ` npm install table-sort-js`
17+
<b>Option 1.</b> Install from npm: ` npm install table-sort-js`
1818

1919
```javascript
2020
import tableSort from "table-sort-js/table-sort.js";
2121
```
2222
Refer to the documentation for examples on using table-sort-js with frontend frameworks such as
2323
[ReactJS.](https://leewannacott.github.io/table-sort-js/docs/react.html)
2424

25-
2. [Download table-sort.js](https://leewannacott.github.io/table-sort-js/table-sort.js) (Select save as.)
25+
<b>Option 2.</b> [Download table-sort.js](https://leewannacott.github.io/table-sort-js/table-sort.js) (Select save as.)
2626

2727
Then add the following script before your HTML table:
2828
```html
2929
<script src="table-sort.js"></script>
3030
```
3131
Refer to the documenation for examples how to use table-sort-js with [HTML.](https://leewannacott.github.io/table-sort-js/docs/html5.html)
32-
#### To make a table sortable:
33-
- Add `class="table-sort"` to HTML &lt;table&gt; tags. Click on the columns heads to sort.
32+
#### To make tables sortable:
33+
34+
- Add `class="table-sort"` to HTML &lt;table&gt; tags.
35+
- Click on table headers to sort columns.
3436

3537
#### Classes:
3638

37-
| table classes | Description |
39+
| &lt;table&gt; classes | Description |
3840
| -------------- | ------------------------------------------------ |
3941
| "table-sort" | Make the table sortable! (Words, numbers, dates) |
4042
| "table-arrows" | Display ascending or descending triangles. |
4143
| "remember-sort"| If clicking on different columns remembers sort of the original column. |
4244

43-
| th classes | Description |
45+
| &lt;th&gt; classes | Description |
4446
| --------------- | ----------------------------------------------------------- |
4547
| "order-by-desc" | Order by descending on first click. (default is aescending) |
4648
| "file-size" | Sort file sizes(B->TiB) uses the binary prefix. (e.g KiB) |
4749
| "data-sort" | Sort by [data attributes](https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes), e.g &lt;td data-sort="42"&gt; |
4850

49-
#### Notes:
50-
51-
- Makes use of natural sorting to sort numerical values correctly.
52-
- If `<thead>` does not exist it will be created by using data from first row. `<tbody>` is optional.
53-
5451
#### Development:
5552
If you wish to contribute, install instructions can be found [here.](https://leewannacott.github.io/table-sort-js/docs/development.html)

0 commit comments

Comments
 (0)