# Change Font in Grid Header

How can I style headers in a grid to be in Arial, 20pt?

g = Plot[x^2, {x, 0, 2}];
Grid[Prepend[{{g, g, g}}, headers]]


(I decided to post this question/answer because I keep stumbling onto this. I know the answer is somewhere in some question but always have a hard time finding the related question)

With ItemStyle option of Grid.

Grid[Prepend[{{g, g, g}}, headers],
ItemStyle -> {Automatic, {1 -> {FontFamily -> "Arial", FontSize -> 20}}}]


This ItemStyle specification says use Automatic styling for the columns. Use Arial 20pt for row 1.

Hope this helps.

Using the Style function with Slot (#), Function (&) and Map (/@)

headers = Style[#, {FontFamily -> "Arial", FontSize -> 20}] & /@ {"A", "B", "C"}
Grid[Prepend[{{g, g, g}}, headers]]


• I'm not entirely familiar with the special characters in Mathematica. I just discovered the Slot, could someone point me to the names of the other two? – Delphine Mar 21 '16 at 16:15
• /@ is simply Map. You can usually figure them out by entering ? /@ or something like FullForm[f /@ g]. – Martin Ender Mar 21 '16 at 16:16
• Thank you! Edited to add that info. – Delphine Mar 21 '16 at 16:18
• @MartinBüttner - but the one that drove me up a wall was that you can't use the question mark on any of these: {@, @@, @@@}. @Delphine - see this post: mathematica.stackexchange.com/questions/18393/… – Jason B. Mar 21 '16 at 16:25
• @JasonB Oh, that's true. It seems that the only thing that still works on those is F1. – Martin Ender Mar 21 '16 at 16:29