MHB Tabular Why wouldn't this work?

  • Thread starter Thread starter Dustinsfl
  • Start date Start date
  • Tags Tags
    Work
AI Thread Summary
The discussion centers on the use of the tabular environment in LaTeX, specifically addressing issues with formatting tables. Participants inquire about the need for special preamble packages when using tabular, with the consensus indicating that it typically does not require any. There is a suggestion to test a simple tabular example to troubleshoot formatting problems. A successful attempt using dollar signs to encapsulate the LaTeX data is mentioned, indicating a solution to the formatting issue. Overall, the conversation emphasizes the importance of understanding the context in which tabular is used and offers practical solutions for common formatting challenges in LaTeX.
Dustinsfl
Messages
2,217
Reaction score
5
Code:
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\ell & m = -2 & m = -1 & m = 0 & m = 1 & m = 2\\
\hline
0 & - & - & 50\sqrt{\pi} & - & -\\
\hline
1 & - & 25\sqrt{3\pi} & 0 & 25\sqrt{3\pi} & -\\
\hline
2 & 100\sqrt{\frac{5}{6\pi}} & 0 & 0 & 0 & 100\sqrt{\frac{5}{6\pi}}
\hline
\end{tabular}
 
Physics news on Phys.org
Code:
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\ell & m = -2 & m = -1 & m = 0 & m = 1 & m = 2\\
\hline
0 & - & - & 50\sqrt{\pi} & - & -\\
\hline
1 & - & 25\sqrt{3\pi} & 0 & 25\sqrt{3\pi} & -\\
\hline
2 & 100\sqrt{\frac{5}{6\pi}} & 0 & 0 & 0 & 100\sqrt{\frac{5}{6\pi}}\\
\hline
\end{tabular}

Try the above.
 
Ackbach said:
Code:
\begin{tabular}{|c|c|c|c|c|c|}
\hline
\ell & m = -2 & m = -1 & m = 0 & m = 1 & m = 2\\
\hline
0 & - & - & 50\sqrt{\pi} & - & -\\
\hline
1 & - & 25\sqrt{3\pi} & 0 & 25\sqrt{3\pi} & -\\
\hline
2 & 100\sqrt{\frac{5}{6\pi}} & 0 & 0 & 0 & 100\sqrt{\frac{5}{6\pi}}\\
\hline
\end{tabular}

Try the above.

This didn't work as well. Is there a special preamble package needed for tabular?
 
dwsmith said:
This didn't work as well. Is there a special preamble package needed for tabular?

Not usually. Are you trying to use tabular in a math or text environment? The tabular is a text environment. Can you try a really simple tabular instance like this:

Code:
\begin{tabular}{|l|r|r|r|}
\hline
Name &1 &2 &3 \\ \hline
Peter &2.45 &34.12 &1.00 \\ \hline
John &0.00 &12.89 &3.71 \\ \hline
David &2.00 &1.85 &0.71 \\ \hline
\end{tabular}

This example is straight out of Math Into $\LaTeX$, by George Gratzer, on page 146. It http://quicklatex.com/cache3/ql_0bd7f0ac3264265cc9e963e6fbd12d5a_l3.png.
 
Ackbach said:
Not usually. Are you trying to use tabular in a math or text environment? The tabular is a text environment. Can you try a really simple tabular instance like this:

Code:
\begin{tabular}{|l|r|r|r|}
\hline
Name &1 &2 &3 \\ \hline
Peter &2.45 &34.12 &1.00 \\ \hline
John &0.00 &12.89 &3.71 \\ \hline
David &2.00 &1.85 &0.71 \\ \hline
\end{tabular}

This example is straight out of Math Into $\LaTeX$, by George Gratzer, on page 146. It http://quicklatex.com/cache3/ql_0bd7f0ac3264265cc9e963e6fbd12d5a_l3.png.

From this information, I just tried dollar signing all the tex data and that worked.
 
Back
Top