# Sortable Table

DevFeed: [Sortable Table](<https://devfeed.tech/articles/sortable-table-19523.md>)

Original publisher: [Read original article](<https://www.codenameone.com/blog/sortable-table/>)

Author: Shai Almog

Published: 2017-08-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [CodeName One](<https://devfeed.tech/sources/codename-one.md>)

Topics: [Sorting](<https://devfeed.tech/topics/sorting.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [code](<https://devfeed.tech/tags/code.md>), [sorting](<https://devfeed.tech/tags/sorting.md>)

## AI overview

The article explains how sortable tables were added to Codename One's core API. Tables can sort values such as numbers and strings, and custom object types can be supported by providing a comparator.

## Source excerpt

Sometimes I get a question on stack overflow that triggers a "yes this should be easy" reflex. I got such a question a couple of weeks ago when I implemented the animated gif support cn1lib and I had another one last week which asked about sorting tables. This is actually pretty easy to do but it's just something we didn't get around to. So I just implemented it and decided this would make a lot of sense in the core API. Sortable tables make a lot of sense and ideally should be the default.