3
$\begingroup$

Is there a way to get this to work?

data = {2, 1, 4, 3};
TableForm[ data, TableHeadings -> { {"L1", "L2", "L3", "L4"}, {"data"} } ]
$\endgroup$
  • 2
    $\begingroup$ Do data = List /@ {2, 1, 4, 3}; $\endgroup$ – march Mar 9 '16 at 18:01
  • 1
    $\begingroup$ This is another way of doing what @march suggests: data = { {2,1,4,3} } // Transpose. $\endgroup$ – gwr Mar 9 '16 at 18:07
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Mar 9 '16 at 18:11
  • $\begingroup$ You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is also useful for learning how to format your questions and answers. You may also find this this meta Q&A helpful $\endgroup$ – Michael E2 Mar 9 '16 at 18:11
3
$\begingroup$

Reformat your data like-so:

data = List /@ {2, 1, 4, 3};

Then,

TableForm[ data, TableHeadings -> { {"L1", "L2", "L3", "L4"}, {"data"} } ]

yields

enter image description here

$\endgroup$

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.