1

Quite new to LaTeX, everything was going fine until tables!

My document class is:

\documentclass[a4paper, twocolumn]{article}

And I'm trying to insert this table into it:

\begin{table*}

\begin{tabular}{| c | p{2cm} | p{2cm} | c | c | c | c | p{4cm} |}
    \hline
    Strain & Mean log growth of Control & NG difference & Standard Error & t value & p value  & Mutation known to be be via. (Montano 2012 pers. comm.) \\ \hline
    421    & 6.29                       & -2.17         & 0.47           & -4.63   & 0.00002  & Missense                                                \\ \hline
    712    & 4.93                       & -3.23         & 1.53           & -2.11   & 0.038888 & Deletion                                                \\ \hline
    881    & 2.54                       & 3.14          & 0.71           & 4.42    & 0.00005  &  Missense causing nonsense mutation  (amber)            \\ \hline
    899    & -0.98                      & 7.37          & 1.99           & 3.71    & 0.00047  &  Missense                                               \\ \hline
    TA102  & 4.84                       & 1.42          & 0.57           & 2.47    & 0.01638  & Missense causing nonsense mutation  (ochre)             \\ \hline

\end{tabular}

\caption Class data statistics

\end{table*}

The end result is a final column that does not seem to be wrapping and a caption which is wrapping in a very peculiar fashion:

compilation result

4
  • 1
    I've had this problem and fixed it by adding a dummy final column.
    – A.Ellett
    Commented Dec 4, 2012 at 18:37
  • the mutation column seems to have c formatting not p{4cm} you may want to use \begin{tabular}{| c | p{2cm} | p{2cm} | c | c | c | p{4cm} |}
    – mythealias
    Commented Dec 4, 2012 at 18:40
  • Tried adding a dummy column to no avail... Doesn't change a thing (as far as I can see, as most of the table is still off the edge of the page)
    – Ben
    Commented Dec 4, 2012 at 18:40
  • Yeah. I'm trying to figure out why that's not working now. :(
    – A.Ellett
    Commented Dec 4, 2012 at 18:50

1 Answer 1

7

You have too many c| in the middle, you only have 7 columns of data but 8 column specifications so your final column is using a c and so does not wrap, rather than use the intended p{4cm}

\caption takes an argument so should be

 \caption{Class data statistics}

As you have it the caption argument is just C

4
  • D'oh fantastic that sorted it, I knew it would be something ridiculously simple that I'd overlooked...
    – Ben
    Commented Dec 4, 2012 at 18:42
  • The caption is still formatted in the same strange way though however.
    – Ben
    Commented Dec 4, 2012 at 18:43
  • 1
    @Ben use \caption{Class data statistics} to fix the caption. The caption command is picking up only the first non whitespace letter (in this case C)
    – mythealias
    Commented Dec 4, 2012 at 18:45
  • Thanks, a lot, I feel like such a clutz asking simple questions- but I guess that's how you learn!
    – Ben
    Commented Dec 4, 2012 at 18:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .