I will show the problem on the following MWE:

       Column[{ Row[{"test", "1"}]  }],
       "CSS" -> None]
$RecursionLimit::reclim: Recursion depth of 1024 exceeded. >>
General::stop: Further output of $RecursionLimit::reclim will be suppressed during this 
calculation. >>

Single Row[{"test", "1"}] without Column produces no error. Also let's assume I can't use Grid.

  • $\begingroup$ Looks like a bug to me. I have found exporting to HTML to be rather buggy in a lot of cases. $\endgroup$
    – m_goldberg
    Nov 4, 2013 at 13:02
  • $\begingroup$ @m_goldberg Ah :( it is rather frustrating because Grid[{{}}] instead of Row[{}] behaves in different way. $\endgroup$
    – Kuba
    Nov 4, 2013 at 13:05

1 Answer 1




ToBoxes@Column[{Row[{"test", "1"}]}]

we get

TagBox[GridBox[{{TemplateBox[{"\"test\"", "\"1\""}, "RowDefault"]}}, <<omitted output>>

That TemplateBox is strange because Row should have translated into RowBox. Let us force it:

kubaExport[x_] := ExportString[ ToBoxes@x
  /. TemplateBox[a_, "RowDefault"] :> RowBox[a] // RawBoxes,
  "HTML", "FullDocument" -> False];

kubaExport[Column[{Row[{"test", "1"}]}]]

yields what you need.

<table class='Output'>
 <tr style='vertical-align: baseline;'>
  <td style='text-align: left;'><span>test1</span></td>

First try

Export with HTML is not happy with anything but cells. Ergo, wrap your objects in a cell. The following code works.

ExportString[Cell@ToBoxes@Column[{Row[{"test", "1"}]}], "HTML", "CSS" -> None]
  • $\begingroup$ You might notice that Export to HTML produces an empty page. That happens because the export functionality is (somewhat) broken for 2D content such as scripts, grids, etc. But that is another question. $\endgroup$
    – Hector
    Nov 4, 2013 at 14:47
  • $\begingroup$ Yes, I was just about to ask :) So the only difference is that there is not error, but still there is no html? I could use Quiet :) $\endgroup$
    – Kuba
    Nov 4, 2013 at 14:50
  • $\begingroup$ @Kuba: Nope, that is not the only difference. Without the wrapping, Mathematica seems to try (and fails at) creating the 2D content with HTML tables. $\endgroup$
    – Hector
    Nov 4, 2013 at 14:56
  • $\begingroup$ I'm glad you didn't delete the answer permanently :) I will test this as soon as I get home. :) $\endgroup$
    – Kuba
    Nov 4, 2013 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.