垂直对齐表格单元格中的数字?

goj*_*ira 9 latex

我试图设计一个有点复杂的表(sidewaystable),在LaTeX中有7行和4列.该表包含文本,bibtex-citations,最重要的是单元格内的数字(目前这些数字是jpeg用于测试目的,最终我想将它们更改为PDF).这些数字非常紧密(有目的).

我有大部分的表格布局,因为我想要它,但数字在单元格的顶部对齐!这看起来很难看,我需要在它们的单元格中垂直和水平对齐它们.

我尝试了几件事(parbox,手动为数组包定义一个新的columntype ......),但根本无法弄清楚如何做到这一点.

以下是我的表的latex-sourcecode基本上是什么样的(文本替换为模型文本):

    % THE TABLE
\begin{sidewaystable}\footnotesize
   \begin{tabular}{| p{3cm} | c | p{6cm} | p{4cm} |}
    \hline
    column1description & column2description & TypeOfOrganism & column4description\\ \hline
    \hline
    Diagram1title & \includegraphics[scale=0.25]{vector_figures/mockup_001.jpg} & description1 & {\em S.\ cerevisiae, E.\ coli}\\ \hline
    Diagram2title & \includegraphics[scale=0.25]{vector_figures/mockup_002.jpg} & description2 & {\em S.\ cerevisiae, E.\ coli}\\ \hline
    Diagram3title & \includegraphics[scale=0.25]{vector_figures/mockup_003.jpg} & description3 & {\em S.\ cerevisiae, E.\ coli}\\ \hline
    Diagram4title & \includegraphics[scale=0.25]{vector_figures/mockup_004.jpg} & description4 & {\em S.\ cerevisiae}\\ \hline
    Diagram5title & \includegraphics[scale=0.25]{vector_figures/mockup_005.jpg} & description5 & {\em S.\ cerevisiae}\\ \hline
    Diagram6title & \includegraphics[scale=0.25]{vector_figures/mockup_006.jpg} & description6 & {\em S.\ cerevisiae}\\ \hline

  \end{tabular}

  \caption[Diagrams and their descriptions]{\textbf{ Diagrams and their descriptions} Some diagrams with interesting descriptions}\label{tab:table2}.

\end{sidewaystable}
Run Code Online (Sandbox Code Playgroud)

如果有人可以给我一些关于如何在其细胞内垂直和水平对齐图形的信息,我将非常感激.

即,图形需要在每个单元格中,使得图形上方和下方的空间到相应的单元格边界,并且左右各自的单元格边界是相同的.

(我发现了一些关于这个或相关表格布局问题的页面,但无法理解实际做什么.)

AVB*_*AVB 1

您可以使用tabularxpackage(或arraypackge)使所有单元格垂直对齐。这可以让你开始:

\usepackage{tabularx}
\begin{document}

\renewcommand{\tabularxcolumn}[1]{>{\arraybackslash}m{#1}}
\begin{tabularx}{\textwidth}{XXXX}
    \hline
    column1description & column2description & TypeOfOrganism & column4description\\ \hline
    \hline
    Diagram1title & the graphics & I would be very thankful if someone
    could give me some information on how to align the figures vertically
    as well as horizontally within their cells.I would be very thankful if someone could give me some information on how to align the figures vertically as well as horizontally within their cells. & {\em S.\ cerevisiae, E.\ coli}\\ 
    \hline\\
    Diagram1title & the graphics & I would be very thankful if someone
    could give me some information on how to align the figures vertically
    as well as horizontally within their cells.I would be very thankful if
    someone could give me some information on how to align the figures
    vertically as well as horizontally within their cells. & {\em S.\
    cerevisiae, E.\ coli}\\ 
    \hline
\end{tabularx}

\end{document}
Run Code Online (Sandbox Code Playgroud)