How do I display a list of values $\{a_1,a_2,\ldots,a_n\}$ in a two column format?

--------- 1 | a_1 2 | a_2 3 | a_3 ...... n | a_n

I tried using TableFormat but this doesn't display the row number.

  • 1
    $\begingroup$ TableForm[list, TableHeadings -> Automatic] $\endgroup$ – ciao Jun 25 '15 at 6:05
  • $\begingroup$ @ciao. This makes more sense than mine. $\endgroup$ – march Jun 25 '15 at 14:54
  • $\begingroup$ Was your question answered? If so, please accept one of the answers below so that we can remove this question from the unanswered list. If not, please tell us how we can improve our answers! $\endgroup$ – march Jul 3 '15 at 22:17
  • $\begingroup$ @pre-kidney. Well, agreed, but ciao doesn't seem to like getting rep (I think when he does answer he posts as CW, which means he doesn't get any even if he gets upvoted): go read the blurb on his user page. $\endgroup$ – march Jul 5 '15 at 4:53


ciao's answer makes the most sense.

TableForm[a /@ Range[5], TableHeadings -> Automatic]

Original Post

Try this. If your list of values is

a /@ Range[5]
(* {a[1], a[2], a[3], a[4], a[5]} *)

then you can do something like

TableForm@Transpose[{Range[5], a /@ Range[5]}]


TableForm@MapIndexed[{First@#2, #1} &, a /@ Range[5]]

(MapIndexed is major overkill. I just like using it recently.)

| improve this answer | |
Table[{n, Subscript[a, n]}, {n, 1, 5}] // TableForm
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.