# tablesort

    .tablesort column:{Int} \
                order:{Ordering = Ordering.ASCENDING} \
                table:{MarkdownContent}
    -> Node

Content copied to clipboard

Sorts a table based on the values of a column.

The sorting is done alphanumerically, hence, for example, `$120`>`$30`, as opposed to the usual lexicographical order.

Example:

    .tablesort {2}
        | Name | Age | City |
        |------|-----|------|
        | John | 25  | NY   |
        | Lisa | 32  | LA   |
        | Mike | 19  | CHI  |

Content copied to clipboard

Result:

    | Name | Age | City |
    |------|-----|------|
    | Mike | 19  | CHI  |
    | John | 25  | NY   |
    | Lisa | 32  | LA   |

Content copied to clipboard

#### Return

the sorted Table node

#### Parameters

column

index of the column (starting from 1)

order

- Optional

sorting order (`ascending` or `descending`)

#### Values

- `ascending`
- `descending`

table

- Likely a body argument

table to sort

#### Wiki page

table-manipulation