1

Probably due to the specifications I made in tabular, I can't put a line that covers all my columns. If I out hline it's too wide and when I put midrule is too short. Can someone help me to put a line that is the right length?

\begin{table}[h!]
  \centering
  \caption{Response of \glspl{Tas2r} stimulated with bitter compounds}
    \begin{tabular}{p{15.93em}p{13.57em}p{12.57em}}
    \textbf{Taste receptor} & \textbf{Ligand} & \textbf{Article} \\
    \hline
    TAS2R38 & ptc   & \cite{meyerhof2010molecular} \\
    TAS2R1, TAS2R10 & dxm   & \cite{meyerhof2010molecular} \\
    TAS2R4, TAS2R7, TAS2R10, TAS2R14, TAS2R39, TAS2R40, TAS2R43, TAS2R44, TAS2R46 & quinine & \cite{meyerhof2010molecular} \\
    mouse Tas2r5 & cycloheximide & \cite{chandrashekar2000t2rs} \\
    chicken Tas2r1 & 10 (5 natural and 5 synthetic) & \cite{behrens2014tuning} \\
    chicken Tas2r2 & 8 (6 natural and 2 synthetic) & \cite{behrens2014tuning} \\
    chicken Tas2r7 & 17 (14 natural and 3 synthetic) & \cite{behrens2014tuning} \\
    turkey Tas2r3 & 15 (12 natural and 3 synthetic) & \cite{behrens2014tuning} \\
    turkey Tas2r4 & 8 (5 natural and 3 synthetic) & \cite{behrens2014tuning} \\
    zebra finch Tas2r5 & 5 (1 natural and 4 synthetic) & \cite{behrens2014tuning} \\
    zebra finch Tas2r6 & 3 (2 natural and 1 synthetic) & \cite{behrens2014tuning} \\
    zebra finch Tas2r7 & 5 (3 natural and 2 synthetic) & \cite{behrens2014tuning} \\
    \end{tabular}%
  \label{tab:ligand}%
\end{table}%
2
  • converting the em specifications in the tabular definition to cm does the trick -- you can now experiment further with the column widths -- the 1em =2.8cm which makes the column extremely wide
    – js bibra
    Dec 2, 2020 at 15:35
  • Please extend your code fragment to complete small document, which we can test as it is and which reproduce your problem. From fragment is not visible, that table code case your problem.
    – Zarko
    Dec 2, 2020 at 15:36

2 Answers 2

1

The big problem is that you're overspecifying the widths, so the table turns out to be wider than the available text width.

I suggest one X column (from tabularx) to cope with the overlong first column entry, but also to use vertical space to separate the groups.

\begin{filecontents*}[overwrite]{\jobname.bib}
@article{meyerhof2010molecular,
 author={X. Meyerhof},
 title={title},
 journal={Journal},
 year={2010},
}
@article{chandrashekar2000t2rs,
 author={Chandrashekar, Y.},
 title={title},
 journal={Journal},
 year={2000},
}
@article{behrens2014tuning,
 author={Behrens, Z.},
 title={title},
 journal={Journal},
 year={2014},
}
\end{filecontents*}

\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx,array}

\newcommand{\glspl}[1]{#1}% because there is no hint on how glossary is used

\begin{document}

\begin{table}[htp!]
  \centering
  \caption{Response of \glspl{Tas2r} stimulated with bitter compounds}
  \label{tab:ligand}

  \begin{tabularx}{\textwidth}{
    @{}
    >{\raggedright}X
    l
    @{}
    c
    @{}
  }
  \toprule
    \textbf{Taste receptor} & \textbf{Ligand} & \textbf{Article} \\
  \midrule
    TAS2R38 & ptc   & \cite{meyerhof2010molecular} \\
  \addlinespace
    TAS2R1, TAS2R10 & dxm   & \cite{meyerhof2010molecular} \\
  \addlinespace
    TAS2R4, TAS2R7, TAS2R10, TAS2R14, TAS2R39, TAS2R40, TAS2R43, TAS2R44, TAS2R46 & quinine & \cite{meyerhof2010molecular} \\
  \addlinespace
    mouse Tas2r5 & cycloheximide & \cite{chandrashekar2000t2rs} \\
  \addlinespace
    chicken Tas2r1 & 10 (5 natural and 5 synthetic) & \cite{behrens2014tuning} \\
%  \addlinespace
    chicken Tas2r2 & 8 (6 natural and 2 synthetic) & \cite{behrens2014tuning} \\
%  \addlinespace
    chicken Tas2r7 & 17 (14 natural and 3 synthetic) & \cite{behrens2014tuning} \\
  \addlinespace
    turkey Tas2r3 & 15 (12 natural and 3 synthetic) & \cite{behrens2014tuning} \\
%  \addlinespace
    turkey Tas2r4 & 8 (5 natural and 3 synthetic) & \cite{behrens2014tuning} \\
  \addlinespace
    zebra finch Tas2r5 & 5 (1 natural and 4 synthetic) & \cite{behrens2014tuning} \\
%  \addlinespace
    zebra finch Tas2r6 & 3 (2 natural and 1 synthetic) & \cite{behrens2014tuning} \\
%  \addlinespace
    zebra finch Tas2r7 & 5 (3 natural and 2 synthetic) & \cite{behrens2014tuning} \\
  \bottomrule
  \end{tabularx}
\end{table}

\bibliographystyle{plain}
\bibliography{\jobname}

\end{document}

I added mock bibliographic entries to get actual numbers. The third column can have no intercolumn space before it because there's no risk of clash due to the wide “Article” header.

The \label is related to \caption, so it belongs near it.

enter image description here

3
  • If I wanted to change "8 (6 natural and 2 synthetic)" to "caffeine, chlorampenicol, coumarin, diphenidol, parthenolide, quinine sulphate and yohimbine" or even longer text on other lines, how could I do it without disrupting the table? Sorry to ask about this again but Im correcting my thesis so I didn't think about this when I first did the table. Dec 9, 2020 at 0:09
  • @RaquelCardoso Make also the second column of type X like the first one. But I'd probably not use a table for such long texts.
    – egreg
    Dec 9, 2020 at 0:25
  • I'm sorry, I thought I had erased this comment, I got there. Yes, I'd like to keep my table as it is but I have to do what they tell me. Thanks and sorry again! Dec 10, 2020 at 1:02
0

enter image description here

\begin{tabular}{p{3cm}p{2cm}p{1cm}}
    \textbf{Taste receptor} & \textbf{Ligand} & \textbf{Article} \\
    \hline
    TAS2R38 & ptc   & \cite{meyerhof2010molecular} \\
    TAS2R1, TAS2R10 & dxm   & \cite{meyerhof2010molecular} \\
    TAS2R4, TAS2R7, TAS2R10, TAS2R14, TAS2R39, TAS2R40, TAS2R43, TAS2R44, TAS2R46 & quinine & \cite{meyerhof2010molecular} \\
    mouse Tas2r5 & cycloheximide & \cite{chandrashekar2000t2rs} \\
    chicken Tas2r1 & 10 (5 natural and 5 synthetic) & \cite{behrens2014tuning} \\
    chicken Tas2r2 & 8 (6 natural and 2 synthetic) & \cite{behrens2014tuning} \\
    chicken Tas2r7 & 17 (14 natural and 3 synthetic) & \cite{behrens2014tuning} \\
    turkey Tas2r3 & 15 (12 natural and 3 synthetic) & \cite{behrens2014tuning} \\
    turkey Tas2r4 & 8 (5 natural and 3 synthetic) & \cite{behrens2014tuning} \\
    zebra finch Tas2r5 & 5 (1 natural and 4 synthetic) & \cite{behrens2014tuning} \\
    zebra finch Tas2r6 & 3 (2 natural and 1 synthetic) & \cite{behrens2014tuning} \\
    zebra finch Tas2r7 & 5 (3 natural and 2 synthetic) & \cite{behrens2014tuning} \\
\end{tabular}%][1]][1]

You must log in to answer this question.

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