The default table alignment is Center, however I would like to make it Right so that MatrixForm by default returns a matrix with right-aligned entries. I have played around with the options inspector setting the option Alignment(TableViewBoxOptions) to {Right, Bottom}, enter image description here

but it does not seem to produce any effect. Also, I noticed a button Apply in the options Inspector window, which is greyed and inactive??


1 Answer 1


Within a session this should work:

SetOptions[MatrixForm, TableAlignments -> Right]

You can make this setting global and persistent by including it in your user init.m file. This file is loaded by each Kernel as it is started. You can find its location by evaluating:

FileNameJoin[{$UserBaseDirectory, "kernel", "init.m"}]

Please make a back-up of this file before modifying it. For more see: Automatically load packages at startup and init.m documentation

TableForm, MatrixForm, and Grid use GridBox, but GridBoxOptions will be overruled by the individual Options of these formatting functions.

I believe that TableViewBox (along with GridBox) is used by the undocumented TableView:

 Array[Times, {5, 5}] // TableView

Also be aware that there is (or was) a bug in TableForm: TableAlignments -> Left not working

  • $\begingroup$ Thanks you for the answer. I did not think of this alternative, and this will probably be sufficient for me. However, I am still intrigued by the question of how to make this the default behaviour globally, not just for a session or for a notebook. Thanks again. $\endgroup$ Commented Dec 22, 2013 at 11:53
  • $\begingroup$ @Emilio I'll update my answer with more specific instruction. $\endgroup$
    – Mr.Wizard
    Commented Dec 22, 2013 at 11:56

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.