# How to create and format a table via menu [closed]

I created a 3x3 table via menu Insert > Table/Matrix > New..., but afterwards I cannot add a new line or column. The tool doesn't add a row of 3 columns, but a row of one column at the end; when adding a new column, it adds at the end of the whole table.

Is there any way to modify a table via menu operations without shooting my brains out (Microsoft Word is so easy to modify a table)?

Update (2015-8-10): Now can add rows and columns; all I had to do was to restart Mathematica since it was bugged. There is still one annoying issue. When I write, it writes in the middle of the column, instead on the left.

How can I make it align the text to the left?

You see on line 203 it writes in the table in the middle (original image is here). :(

I am almost there if I do the following: I use Grid["here goes your table", Frame -> All, Alignment -> Left]. The output looks good but it is read only. To fix it I have to put in the original table all text between "" which is a pain. Is there any better solution?

• Use Ctrl-, and Ctrl-Enter. Please rewrite your question, make it to the point, and remove the cursing. Aug 3, 2015 at 13:20
• If you like the Microsoft Word that much, why not to use it without any danger to the body, brains or not. If I make tables in Mma I usually do it programatically clean and easy, my body being perfectly safe. If you would like to try this approach, check Menu/Help/DocumentationCenter/Grid and refine your question, if necessary. Have fun! Aug 3, 2015 at 13:27
• I am sure there is a real question in here somewhere, but I really could not understand it at all. I think the best thing would be to rewrite it more clearly, otherwise there is little chance of receiving help. I vote to close for now, but urge you to clarify the question so that it can be re-opened. Aug 11, 2015 at 22:30
• Aug 12, 2015 at 14:07
• Possible duplicate: mathematica.stackexchange.com/questions/17004/… Feb 16, 2016 at 14:16

ctrl-, (comma) adds a new column at the column where you insertion point cursor is located. ctrl-return adds a row there. Just make sure you have the insertion point cursor (vertical blinking bar) visible in the matrix and you do not have selected anything.

• I will try tomorrow. Now I am too nervous and I am afraid I will destroy my laptop by punching it Aug 3, 2015 at 15:35
• And... did it work for you now? Aug 7, 2015 at 10:43
• i havent tried yet :( I must muster the courage Aug 7, 2015 at 21:56
• it worked now .... maybe i just needed a restart , that doesnt mean your answer is completeley useless Aug 10, 2015 at 8:56
• Where is this in the menus? Jun 10, 2019 at 21:34

You can use GridBoxOptions and set GridBoxAlignment via the Options Inspector. (See also tutorial/OptionsForExpressionInputAndOutput -- documentation is scarce.)

To set all items to be aligned left, GridBoxAlignment should be set to

GridBoxAlignment -> {"Columns" -> {{Left}}}


(Enter {"Columns" -> {{Left}}} in Value column for the option GridBoxAlignment.)

Before:

After:

I figure these things out by setting up a sample Grid they way I'd like and look at the cell expression (menu Cell > Show Expression).

Grid[IdentityMatrix[2], Alignment -> Left]

(*  Cell > Show Expression:
Cell[BoxData[
TagBox[GridBox[{
{"1", "0"},
{"0", "1"}
},
AutoDelete->False,
GridBoxAlignment->{"Columns" -> {{Left}}},
GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
"Grid"]], "Output",
CellChangeTimes->{3.648293359029784*^9}]
*)


If you have a lot of such tables and you want them all to have the same style, then one should create a style in the stylesheet with the desired GridBoxOptions and so forth. Then the grid can be styled with the menu command Format > Style > Other....

Other GridBoxOptions may be found via Format > Option Inspector....

• I am almost close to solution i use: Aug 11, 2015 at 17:13
• I want to do a similar thing but to create a darker line separating the row and column headers... but now after seeing how complicated it might be, I'm a bit scared to try! Jun 10, 2019 at 21:36
• @Michael Create your table in a cell. Select the whole table and just the whole table. Open the option inspector (menu Format). Enter Gridbox in the search field of the option inspector. Find GridboxDividers. You should see {} under the column labeld Value. Click it. The {} should be highlighted. Paste in {"ColumnsIndexed" -> {2 -> Directive[AbsoluteThickness[4], GrayLevel[0]]}, "RowsIndexed" -> {2 -> GrayLevel[0]}} or whatever color and thickness you want. This is better done via style sheets. On the whole, this sort of formatting is both possible and extremely cumbersome. Jun 10, 2019 at 22:24