Emacs tabulated list mode

A simple example of tabulated-list-mode usage in Emacs. For more details see docs

Tabulated list is a major mode, so in order to use it we need to:

Define major mode:

(define-derived-mode list-demo-mode tabulated-list-mode "list-demo-mode"
  "Major mode for tabulated list example."
  (setq tabulated-list-format [("Column_1" 10 t)
                               ("Column_2" 10 nil)
                               ("Column_3"  10 t)
                               ("Column_4" 0 nil)]);; last columnt takes what left
  (setq tabulated-list-entries (list
                                (list "1" ["50" "A2" "A3" "A4"])
                                (list "2" ["10" "B2" "B3" "B4"])
                                (list "3" ["15" "C2" "C3" "C4"])))
  (setq tabulated-list-padding 4)
  (setq tabulated-list-sort-key (cons "Column_1" nil))
  (tabulated-list-init-header)
  (tabulated-list-print t))

And resulting table will look like that:

Tabulated list: