Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
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." –  cormullion Oct 18 '13 at 15:02
1  
As a workaround you can pad with "" list = {{"a", "b", "c"}, {"d", "e"}}; TableForm[PadRight[list, Automatic, ""], TableHeadings -> Automatic] –  ssch Oct 18 '13 at 15:05
    
@ssch please consider posting this as an answer :) –  Kuba Apr 27 at 12:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.