2

I very new to Latex and have a problem with a table. I created the table using the site http://www.tablesgenerator.com/.

When i put my code into Latex, the table is too wide to fit the page. How can I go around this?

Code:

\begin{table}[]
\begin{tabular}{
>{\columncolor[HTML]{FFCCC9}}c 
>{\columncolor[HTML]{EFEFEF}}c 
>{\columncolor[HTML]{EFEFEF}}c 
>{\columncolor[HTML]{EFEFEF}}c 
>{\columncolor[HTML]{EFEFEF}}c cccc}
\textbf{Receptor name} & Formyl peptide receptor 1 and 2                     
& CXC chemokine receptor 1 and 2                        & Leukotriene B4 
Receptor & Platelet-activating factor receptor & Free fatty acid receptor 2 
& G-protein-coupled receptor 84 & Purinergic receptor 2 & Anaphylatoxin 
receptor 1 +2                             \\
\textbf{Gene name}     & \begin{tabular}[c]{@{}c@{}}FPR1\\ FPR2\end{tabular} 
& \begin{tabular}[c]{@{}c@{}}CXCR1\\ CXCR2\end{tabular} & BLT                     
& PAFR                                & GPR43                      & GPR84                         
& P2Y2R                 & \begin{tabular}[c]{@{}c@{}}C5AR 1\\ C5AR 
2\end{tabular} \\
\textbf{Ligands(s)}    & N-Formyl-peptides                                   
& CXC chemokines (Interleukin 8)                        & Leukotrienes,B4         
& Platelet-activating factor          & Short-chain fatty acids    & LPS                           
& Nucleotides           & Anaphylatoxin                                          

\end{tabular}
\caption{Table describing receptor name, gene name and ligands for the 
various receptors of neutrophils 
\parencite{Futosi2013NeutrophilPathways,Scott2004LeukotrieneMice}}.

\label{Other receptors}
\end{table}
  • Try the adjustbox environment – Kun Jun 7 '17 at 12:29
  • What is that? Im very new to latex – Alex Jun 7 '17 at 12:59
  • This is a common problem with multiple possible solutions. Search "table too wide" or look at the related questions for examples. – John Kormylo Jun 7 '17 at 13:03
  • Welcome to TeX.SE! please, expand your code sniped to complete small document with \documentclass{...} on the beginning and \end{document} on the end. Without to see your page layout and used packages it is difficult/impossible to help you. Help us to help you! – Zarko Jun 7 '17 at 13:33
1

Based on guessing:

enter image description here

As far as I was able to see, your table is to huge to be placed even if it is rotated. You should consider to redesign your table in the way, that you interchange rows and columns:

\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage[table]{xcolor}
\usepackage{booktabs}
\newcolumntype{L}{>{\RaggedRight}X}

\begin{document}
    \begin{table}[ht]
    \centering
    \renewcommand\arraystretch{1.2}
\begin{tabular}{@{} *{3}{l} @{}}
    \toprule
Receptor name                       &   Gene name       &   Ligands(s)          \\
    \midrule
Formyl peptide receptor 1 and 2     &   FPR1, FPR2      &   N-Formyl-peptides   \\
CXC chemokine receptor 1 and 2      &   CXCR1, CXCR2    &   CXC chemokines (Interleukin 8) \\
Leukotriene B4 Receptor             &   BLT             &   Leukotrienes, B4    \\
Platelet-activating factor receptor &   PAFR            &   Platelet-activating factor  \\
Free fatty acid receptor 2          &   GPR43           &   Short-chain fatty acids \\
G-protein-coupled receptor 84       &   GPR84           &   LPS                 \\
Purinergic receptor 2               &   P2Y2R           &   Nucleotides         \\
Anaphylatoxin receptor 1 +2         &   C5AR 1 C5AR 2   &   Anaphylatoxin       \\
    \bottomrule
\end{tabular}
    \caption{Table describing receptor name, gene name and ligands for the
various receptors of neutrophils
%\parencite{Futosi2013NeutrophilPathways,Scott2004LeukotrieneMice}
            }.
\label{Other receptors}
    \end{table}
\end{document}

Please check, If I correctly transpose your table :)

  • @Alex, if answer solve your problem (frankly said, you haven't other sensible option), you can accept it (by clicking check mark at top left side of answer) :) – Zarko Jun 7 '17 at 17:07
0

You can start by adding \small, \tiny etc just after the declaration of the table environment. Example: \begin{table}[ht]\tiny.

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.