formatting th moved into it's own method

it's now possible to create tables that are sortable, example added