Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

EDIT: István Zachar informed me of the Rasterize[] command, which does exactly what I need. Danke!

I have a self-built function that uses Grid[] to create a table that is more presentation-friendly than TableForm. Example output is:

Example output of dougTable

What I usually do to copy this into a presentation is take a screenshot with the Snipping Tool. For plots, I can just select the plot in Mathematica and then select Edit -> Copy As -> Bitmap. I want to be able to do the same with this table. Right now, if I try selecting the table, I get a cursor and can start typing in the figure.

I was hoping there was a Mathematica function that just puts a selectable bounding box around the entire output of a function, but I've been unable to find one yet. Does anyone have any ideas on how to make this entire table selectable?

Source code for my function can be found below, although you shouldn't need to use it to find a solution to the problem: any function with a non-graphic default output should work fine.

dougTable[data_List, cols_List: {}, rows_List: {}] :=
  {genOpts, none, colHead, rowHead, both, font},
  genOpts = {Frame -> All, Background -> RGBColor[1, .9, 0], 
    FrameStyle -> Thickness[1]};
  font = {FontFamily -> "Arial", FontSize -> 12, FontWeight -> "Bold"};
  none = {genOpts, 
    Dividers -> {{1 -> Thickness[2], -1 -> Thickness[2]}, {1 -> 
        Thickness[2], -1 -> Thickness[2]}}};
  both = {genOpts, 
    Dividers -> {{1 -> Thickness[2], -1 -> Thickness[2], 
       2 -> Thickness[2]}, {1 -> Thickness[2], -1 -> Thickness[2], 
       2 -> Thickness[2]}}, 
    ItemStyle -> {{Directive[font], Automatic}, {Directive[font], 
  colHead = {genOpts, 
    Dividers -> {{1 -> Thickness[2], -1 -> Thickness[2]}, {1 -> 
        Thickness[2], -1 -> Thickness[2], 2 -> Thickness[2]}}, 
    ItemStyle -> {Automatic, {Directive[font], Automatic}}};
  rowHead = {genOpts, 
    Dividers -> {{1 -> Thickness[2], -1 -> Thickness[2], 
       2 -> Thickness[2]}, {1 -> Thickness[2], -1 -> Thickness[2]}}, 
    ItemStyle -> {{Directive[font], Automatic}, Automatic}};

  Which[Length[cols] == 0 && Length[rows] == 0, Grid[data, none],
   Length[cols] != 0 && Length[rows] == 0, 
   Grid[Prepend[data, cols], colHead],
   Length[cols] == 0 && Length[rows] != 0, 
   Grid[MapThread[Prepend[#1, #2] &, {data, rows}], rowHead],
   Length[cols] != 0 && Length[rows] != 0, 
   Grid[Prepend[MapThread[Prepend[#1, #2] &, {data, rows}], cols], 
share|improve this question
up vote 7 down vote accepted

If you select your output cell (by the bracket on the right), it can be converted to bitmap via the Cell $\rightarrow$ Convert To $\rightarrow$ Bitmap menu option. For programmatic conversion:

If you prefer bitmaps, you can rasterize your table:

table = TableForm[{{5, 7}, {4, 2}, {10, 3}},
    TableHeadings -> {{"A", "B", "C"}, {"1", "2"}}];


Mathematica graphics

If you want to keep the structure of your copied object, use Graphics or GraphicsGrid (though both require the manual setup of an appropriate ImageSize):

{GraphicsGrid[{{table}}, ImageSize -> 100], Graphics[Inset@table, ImageSize -> 100]}

Mathematica graphics

share|improve this answer
The Rasterize[] function is what I was looking for! Thanks. – dthor Oct 26 '12 at 17:41

Your Answer


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.