Search code examples
google-colaboratorymathjax

How to add spaces in mathjax table cell?


In Google Colaboratory I can make a table using mathjax embedded in markdown. But spaces between words, e.g. table header, disappear when the code is rendered.

$$
\begin{array}{|c|c|c|c|}
\hline
 & table header & table header & table header \\ \hline
table content & table content & table content & table content\\ \hline
\end{array}
$$

This code is rendered like this:

table with words without space between them

How do I add spaces between words of a table cell?


Solution

  • You should use & \text{table header} & in each cell. Seems the cells are default to math-mode, which removes spaces.