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.

My question is rather simple. I want to put a title into a table.

For example, consider a list with depth two and a title

list = Range[4] & /@ Range[4];
title = "Bravo";

And I want to create a table from list, i.e.,

TableForm[list]

This will generate a table without a title. Let's say I want to make a title "Bravo" on top of the table(which is center-aligned).

Can you suggest a neat way to achieve it? I looked up the possible options for TableForm, but I could not find a relevant one.

share|improve this question

3 Answers 3

up vote 4 down vote accepted
Labeled[TableForm[list], title, Top]
share|improve this answer

Here is another approach using only the functionality of TableForm itself:

list = Range[4] & /@ Range[4];
title = "Bravo";
TableForm[{{list}}, TableHeadings -> {None, {title}}]

table

This nests the list deep enough inside {{ }} so that the column labels provided by TableHeadings are applied only to a single column containing the actual table. The result is that the column heading has become a table heading for the inner table.

share|improve this answer
Column[
{ToString["This is the title"],
TableForm[yourdata]},
Alignment-> Center]
share|improve this answer

Your Answer

 
discard

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

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