# Document Creation: inserting a grid

This question is strongly related to:

NotebookWrite Cell with Grid

Let’s create sample chart

mydata = {{"Noise Density \n(\[Mu]g/\!$$\*SuperscriptBox[\(Hz$$, \
$$0.5$$]\))", "Mean", "StDev", "Min", "Q1", "Median", "Q3",
"Max"}, {"X ", 5., 4., 21., 26., 29., 33., 35.}, {"Y ", 25., 5.,
18., 20., 25., 29., 34.}, {"Z ", 39., 4., 30., 38., 39., 40.,
47.}};

myChart =
Grid[mydata
, BaseStyle -> {FontFamily -> "Helvetica Neue"
, FontTracking -> "SemiCondensed", FontWeight -> “Thin”, FontSize -> 10}
, Frame -> True
, Dividers -> {{True, True}, {True, True}}
, Spacings -> {2, 1}
, Alignment -> {{Center, Left}, Right}
, Background -> {{1 -> LightGray}}]


The chart renders OK on evaluation:

However, when I try to write the chart to a new document:

CreateDocument[ ExpressionCell@myChart]


It inserts it as follows:

What is the correct method of writing a grid to a document?

-
Does this work for what you need: CreateDocument[ExpressionCell[myChart, ShowStringCharacters -> False]]? – kglr Apr 18 '14 at 15:21
Great… if you post it as an answer that would be great… – Pam Apr 18 '14 at 15:26
@kguler: I can’t seem to do: SetOptions[ExpressionCell, ShowStringCharacters -> False]; and have it propagate through out my document creations… any ideas? – Pam Apr 18 '14 at 15:28
SetOptions[EvaluationNotebook[], ShowStringCharacters -> False] works? – kglr Apr 18 '14 at 16:17
Yes. That seems to work – Pam Apr 18 '14 at 20:13

CreateDocument[ExpressionCell[myChart, ShowStringCharacters -> False]]


-
Sometimes I feel like the amount of styling options with unintuitive default behaviour is "too ... high" :) – Kuba Apr 18 '14 at 16:26
@Kuba, agree .. :) – kglr Apr 18 '14 at 16:27
:-) Not to mention that ShowStringCharacters does not appear in the Documentation for ExpressionCell – Pam Apr 18 '14 at 20:13

Use the expression cell style, "Print":-

CreateDocument[ExpressionCell[myChart, "Print"]]

-
"Output" will work too but with both there is a difference in CellMargins in comparision to simple ExpressionCell. – Kuba Apr 18 '14 at 16:50