tags:

views:

1184

answers:

3

This is my first Latex doc. Using Latex8.sty I'm trying to include a 5 column table. I've commented out everything but the introdution and the table. When I make the pdf it shows the introduction but no table. Any tips?

\begin{tabular}{|ll||l|c|r|rr}
 Mass&a1&a2&Fprime1&Fprime2\\
 \hline
 70g&0.988m/s^2&-2.79m/s^2&467.364N&424.02N\\
 80g&1.36m/s&-2.81m/s^2&3.84N&427.12N\\
 90g&1.70m/s^2&-2.74m/s^2&471.5N&416.48N\\
 100g&1.84m/s^2&-2.76m/s^2&491.12N&419.52N\\
 150g&3.11m/s^2&-2.88m/s^2&530.78N&437.76N\\\hline
\end{tabular}
+1  A: 

This example renders a correct-looking table. Notice the '$' around "m/s^2" (I dont know how it worked at all for you without those).

\documentclass[a4paper,openany]{book}
\begin{document}
\begin{tabular}{|ll||l|c|r|rr}
 Mass&a1&a2&Fprime1&Fprime2\\
 \hline
 70g&$0.988m/s^2$&$-2.79m/s^2$&467.364N&424.02N\\
 80g&$1.36m/s$&$-2.81m/s^2$&3.84N&427.12N\\
 150g&$3.11m/s^2$&$-2.88m/s^2$&530.78N&437.76N\\\hline
\end{tabular}
\end{document}
ADEpt
A: 

Thanks for the help! Works great now.

You might as well mark my answer as "accepted" :)
ADEpt
Probably better to delete this post and edit your original question, adding the info from ADEpt, and accepting his answer.
Matt J
+1  A: 

To improve the appearance of your table, you might also look at the booktabs package.

To generate your table with the booktabs package, use the same tabular environment, but add \toprule, \midrule, and \bottomrule commands:

\documentclass[a4paper,openany]{book}
\usepackage{booktabs}% for prettier tables
\begin{document}
\begin{tabular}{|ll||l|c|r|rr}
\toprule
 Mass&a1&a2&Fprime1&Fprime2\\
\midrule
 70g&$0.988m/s^2$&$-2.79m/s^2$&467.364N&424.02N\\
 80g&$1.36m/s$&$-2.81m/s^2$&3.84N&427.12N\\
 150g&$3.11m/s^2$&$-2.88m/s^2$&530.78N&437.76N\\
\bottomrule
\end{tabular}
\end{document}

Read through the booktabs documentation for a short discussion about how tables should look (according to the author, at least).

If you want to be even more pedantic, you might also look at the units package for typesetting the units. You could set the header of your table to:

Mass & $a_1$ & $a_2$ & $F'$ & $F''$ \\

unless you need to keep the variable names spelled out.

godbyk
You definitely want to look at the siunitx package, which supercedes units (among other packages).
Will Robertson