Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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, 
  FontColor->RGBColor@@RandomReal[{0,1},3]], 
  Background->RGBColor@@RandomReal[{0,1},3], 
  FrameStyle->AbsoluteThickness[3]]&, 
  resultListToUse[[i]],{2}], 
  Alignment->{{Center,Center,Center}}, 
  Frame->All, 
  ItemSize->{20,5}, 
  Spacings->{{20,20,20},1}],{i,Length@resultListToUse[[1;;4]]}], 
  Background->LightRed]

Here is my sample blog:

quaternions.blog.163.com/blog/static/206082147201323095141897

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
    
quaternions.blog.163.com/blog/static/206082147201323095141897 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

1 Answer 1

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]];

SeedRandom[1];

col = Column@Riffle[
  Framed[#,
    Background -> RGBColor[RandomReal[{0,1}, 3]],
    FrameMargins->2] & /@ list,
  Framed[
    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 quaternions.blog.163.com/blog/static/206082147201323111551679 –  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

 
discard

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.