5
$\begingroup$

For a list list = {{"a", "b", "c"}, {"d", "e"}}; Table heading lines do not show up

TableForm[list, TableHeadings -> Automatic]

enter image description here

But it works if the list list = {{"a", "b", "c"}, {"d", "e", "f"}};

TableForm[list, TableHeadings -> Automatic]

enter image description here

It seems the lines appear only for rectangular list. Is this a bug or i am missing something? I use v9.0.1 Thank you.

$\endgroup$
  • 1
    $\begingroup$ I think Mathematica calls these "ragged tables", and doesn't draw the lines: "Arrays in which all sublists at a particular level are not of the same length display as ragged tables." $\endgroup$ – cormullion Oct 18 '13 at 15:02
  • 4
    $\begingroup$ As a workaround you can pad with "" list = {{"a", "b", "c"}, {"d", "e"}}; TableForm[PadRight[list, Automatic, ""], TableHeadings -> Automatic] $\endgroup$ – ssch Oct 18 '13 at 15:05
  • $\begingroup$ @ssch please consider posting this as an answer :) $\endgroup$ – Kuba Apr 27 '14 at 12:51

Your Answer

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

Browse other questions tagged or ask your own question.