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

Question 1(Color Lost Question[Solved by using Item]): When I evaluate the cell generated by

Grid[WordData /@ {"what","my"}, Frame -> True, 
  Background -> {None, {LightRed, Pink}}]

enter image description here enter image description here

it looks good in my notebook, but the color get lost when I save the notebook as an HTML file. The same thing happens with some other functions, such as Column.

I've spent some time to solve the problem and I found a solution which can partly solve the problem is to use Item to set the background colour.

However, the ItemSize is still not working properly when the notebook is saved as HTML format.

Here is the code:

Column[Table[Grid[Map[Item[Text@Style[#, FontSize->50, 

Here is my sample blog:

Now I can select the words in the colored frame, however the words in one row are two tight with no enough spaces. Because some options such like ItemSize and Spacings didn't work properly when the notebook is saved as .html

question2(Spaces Lost question): I want to convert the cell generated by Grid to HTML format with content is "Plaintext".

I found that the ItemSize setting will no longer work properly when convert the output cell to HTML format.

As cormullion show in the answer, when The output content in HTML is gif pictures, they looks good.

How to make the words in one row with enough spaces?

share|improve this question
The other version of your question on Stackoverflow is probably better. It's not clear here whether you want a reason, think it's a bug, or want a solution. – cormullion Mar 30 '13 at 17:26
I've tried a lot, I found a half-archieved solution is to use Item to set the background color. But the ItemSize is still not working when save as .html file. – HyperGroups Mar 31 '13 at 1:00 Here is my sample blog, Now I can select the words in the colored frame, however they are two tight aligned for ItemSize and other things not work when save as .html There is the code: – HyperGroups Mar 31 '13 at 1:02
up vote 2 down vote accepted

I'm still not clear what you're looking for, but, with a slightly modified version of the code (from your web page):

list = DictionaryLookup[x__ /; x == StringReverse[x]];


col = Column@Riffle[
    Background -> RGBColor[RandomReal[{0,1}, 3]],
    FrameMargins->2] & /@ list,
    TableForm[#, TableSpacing->{2,5}], 
    Background -> RGBColor[RandomReal[{0,1}, 3]],
    FrameMargins->2] & /@ (WordData /@ list)];

Framed[col, Background->Lighter@Pink]

On the left is Mathematica, on the right is the HTML page. I think they did a pretty good job.

two windows

share|improve this answer
Yes,thanks for paying attention. But, I cannot select the words in the .html files They were rasterized into .gif files. Here is another form via using TableForm – HyperGroups Apr 1 '13 at 2:38
I want to convert the cell generated by Grid Function in Mathematica Notebook to "text form" in the .html files, and the options of ItemSize,Background, will convert to width height, background-color: ... in .html or css source, Maybe I should use ConversionRules to gain better effect? – HyperGroups Apr 1 '13 at 2:49

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.