1
$\begingroup$

I have a list as

{{100, 0.834189, 6.61855, 16.8056, 1.}, {101, 0.834123, 6.65273, 
  16.9009, 1.}, {102, 0.834059, 6.68675, 16.9957, 1.}, {103, 0.833995,
   6.7206, 17.0901, 1.}, {104, 0.833931, 6.7543, 17.184, 1.}, {105, 
  0.83387, 6.78782, 17.2775, 1.}, {106, 0.833809, 6.8212, 17.3706, 
  1.}, {107, 0.833746, 6.85442, 17.4633, 1.}, {108, 0.833685, 6.88749,
   17.5556, 1.}, {109, 0.833626, 6.92041, 17.6474, 1.}, {110, 
  0.833567, 6.95318, 17.7389, 1.}}

when I use TableForm command I get a table with 5 columns, Now I want to assign a name for each column so that it appears on top of the column, How can do so? Suppose the name columns are: one, two, three, four, five

$\endgroup$
1
  • $\begingroup$ You want the TableHeadings option in TableForm or, for more flexibility, you can roll your own system using Grid. $\endgroup$
    – MarcoB
    Commented Dec 12, 2019 at 15:10

1 Answer 1

4
$\begingroup$

Option TableHeadingsmight help :

data={{100, 0.834189, 6.61855, 16.8056, 1.}, {101,0.834123, 6.65273,16.9009, 1.}, {102, 0.834059, 6.68675, 16.9957, 1.},{103, 0.833995,6.7206, 17.0901, 1.}, {104,0.833931,6.7543,17.184,1.}, {105,0.83387, 6.78782, 17.2775, 1.}, {106,0.833809,6.8212,17.3706,1.}, {107, 0.833746, 6.85442, 17.4633, 1.}, {108,0.833685, 6.88749,17.5556, 1.}, {109, 0.833626, 6.92041, 17.6474, 1.},{110,0.833567, 6.95318, 17.7389, 1.}}
TableForm[data,TableHeadings -> {{}, {"c1", "c2", "c3", "c4", "c5"}}]

enter image description here

$\endgroup$
2
  • $\begingroup$ Many thanks, that's ok $\endgroup$
    – Wisdom
    Commented Dec 12, 2019 at 15:10
  • $\begingroup$ You are welcome $\endgroup$ Commented Dec 12, 2019 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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