0

I'm trying to generate the following table:

\documentclass[PhD,binding=0.6cm]{Thesis} 
\usepackage{booktabs}
\begin{document}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}     
\begin{table*}     
  \ra{1.3}              
  \begin{tabular}{@{}rrrrcrcrc@{}}
    \toprule 
    & \multicolumn{1}{c}{$Signatures$}  & \multicolumn{3}  {c}{$Genes$} & \phantom{abc}& \multicolumn{1}{c}{$Cellular Context$} & \phantom{abc} & \multicolumn{1}{c}{$Organism$}\\      
    & $UP$ & $DN$ & $Tot$ \\
    \midrule       
    ZEB1 & - & -  & 29 && BC && HUMAN \\
    EGFR & -  & - & 487 && CC, Epitelial Cells && HUMAN\\            
    \bottomrule
  \end{tabular}
  \caption{Signatures details}
\end{table*}
\end{document} 

Unfortunately the headers seems not to be aligned. In addiction the content seems to be on the right end of each line while I would like to center it.

0

1 Answer 1

2

Currently you have a table of three rows. When looking at your document it appears you want to have a table with four rows.

Furthermore, you specify 10 columns:

\begin{tabular}{@{}rrrrcrcrc@{}}

But in every row specification you only have 8 elements (and do you need 8 columns or 6?). Also, when I look at the resulting document from your LaTeX code, it is unclear to me if UP and DN belong to Signatures or Genes.

You probably want to fix your table first, then everything should be much clearer and alignment problems will be easy identifiable and solvable. If you want UP, DN and Tot to be under Signatures or Genes, you will need to insert a second row before your midline that is empty except for UP, DN and Tot, it should not be part of the first row, so like this (if 6 colums is enough, otherwise you need to add 2 more empty elements):

& UP & DN & Tot & & \\

I also would not use $$ around regular words, they are meant for formula.

Perhaps the above is enough, but if you can show me what the table should look like, I should be able to help more. I have made an example of what I think might be what you want (minus advanced layout options):

  \begin{tabular}{cccccc}

    \toprule

    Signatures  &   \multicolumn{3}{c}{Genes}   & Cellular Context      & Organism  \\
                &   UP  &   DN  &   Tot         &                       &           \\
    \midrule

    ZEB1        & -     & -     & 29            & BC                    & HUMAN     \\
    EGFR        & -     & -     & 487           & CC, Epitelial Cells   & HUMAN     \\  

    \bottomrule    

  \end{tabular}
1
  • Dear Niels, it is exactly what I need!!!!!!! Thank you a lot!!!!!!
    – elb
    Jul 22, 2014 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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