宽表、图文问题、多列等

宽表、图文问题、多列等

我目前正在写一份实习报告,并试图在一个宽表中总结一些信息。到目前为止,我得到了这个(我的文档中的表格更宽,但宽度在这里不是问题):

\documentclass[11pt,fleqn,english]{report}
\usepackage[utf8]{inputenc}
\usepackage[OT1]{fontenc}
\usepackage{lscape,pdflscape,rotating}
\usepackage{tabularx,float,makecell,hhline,longtable}
\usepackage[longtable]{multirow}

\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}

\begin{document}

\begin{landscape}
\begin{longtable}{||c|c|l|l|l||}
\hhline{|t:=====:t|}
\textit{\textbf{V}}         & \textbf{Photo}                                    & \multicolumn{1}{c|}{\textbf{Specifications}}                                                  & \multicolumn{1}{c|}{\textbf{Pros}}                            & \multicolumn{1}{c||}{\textbf{Cons}}                                               \endfirsthead
\hline
\textit{1}              & \includegraphics[height=0.11\textheight]{SQUARE.PNG}                              & \begin{tabular}[c]{@{}l@{}}Spec. 1\\Moderately long description\end{tabular}  & \begin{tabular}[c]{@{}l@{}}Simple\\Easy to make and build\end{tabular}                            & \begin{tabular}[c]{@{}l@{}}Sharp edges\\Basic\end{tabular}                        \\
\hline
\textit{2}              & \includegraphics[height=0.15\textwidth]{LONG.PNG}                                 & \begin{tabular}[c]{@{}l@{}}Blablabla\\blablablablabla\end{tabular}        & \begin{tabular}[c]{@{}l@{}}Blablabla\\Blablabla\\Blablablablabla\end{tabular}             & \begin{tabular}[c]{@{}l@{}}Short bla\\Not working\end{tabular}            \\
\hline
\textit{3}              & \includegraphics[width=0.1\textheight]{WIDE.PNG}                                  & Tested : size, shape, other feature                       & \begin{tabular}[c]{@{}l@{}}Very nice shape\\2 is barely enough\end{tabular}       & \begin{tabular}[c]{@{}l@{}}Wrong shape tho\\Goodn't\end{tabular}  \\
\hline
\multicolumn{1}{||l|}{\textit{4}}   & \multicolumn{1}{l|}{\includegraphics[width=0.1\textheight]{SQUARE.PNG}}   & \begin{tabular}[c]{@{}l@{}}Tested : new shape\\Big thingie\end{tabular}                   & \begin{tabular}[c]{@{}l@{}}Optimized funct.\\Stronk part\\Very good color\end{tabular}    & Wrong scale                           \\
\hline
\multicolumn{1}{||l|}{\textit{5}}   & \multicolumn{1}{l|}{\includegraphics[width=0.1\textheight]{WIDE.PNG}}         & Tested : Adam Savage                          & Idem                                                                                                              & Oversized                         \\
\hline
\multicolumn{1}{||l|}{\textit{6}}   & \multicolumn{1}{l|}{\includegraphics[width=0.1\textheight]{WIDE.PNG}}         & Meant to be last try                                                                      & Idem                                                                                                                  & Actual failure                            \\
\hline
\multicolumn{1}{||l|}{\textit{7}}   & \multicolumn{1}{l|}{\includegraphics[width=0.1\textheight]{SQUARE.PNG}}   & Opening mecanism                                                                          & Soft opening                                                                                                  & Unable to be built                            \\
\hhline{|b:=====:b|}
\caption{Part versioning.}
\label{tab:PartTable}
\end{longtable}
\end{landscape}

\end{document}

给予我们:

代码结果

我们可以看到:

  • 当我们tabular在一个单元格中使用环境来实现多行书写时,第二列单元格(与使用在同一行tabular)中的内容无法在单元格中垂直居中。看起来它只显示在环境的第一行上tabular
  • 这些照片与单元格的水平线重叠
  • 再次,当我们使用tabular环境时,文本不会垂直居中;

我确切想要的是如下描述:

  • 标题水平居中;
  • 前两个(数字和图片)水平(和垂直)居中;
  • 所有其他文本(从第 2 行第 3 列“Spec. 1”到右下角“无法构建”)垂直居中并左对齐;
  • 图片不要超出表格的线;
  • 如果可能的话,我希望看到每张图片上方和下方的边距相同,就尺寸而言。

我已经浏览了很多(已经问过的)问题,包括来自北美航空服务指数迈克尔JSG91等等,并没有找到适合我的问题的解决方案。

我完全清楚我可能错过了很多东西,无论是在论坛上还是在互联网上,所以我完全理解简单地重定向到一个相关且非常相似的问题。任何帮助都将不胜感激,无论是建议、完整更正、简短评论还是只是编译成所述结果的完整另一段代码。

提前致谢,祝您有美好的一天。<3

马克

答案1

以下可以作为起点:

在此处输入图片描述

\documentclass[11pt]{report}
\usepackage{pdflscape}
\usepackage{makecell,hhline,longtable}


\usepackage[column=0]{cellspace}
\newcommand{\imageborder}{2pt}
\setlength\cellspacetoplimit{\imageborder}
\setlength\cellspacebottomlimit{\imageborder}

\usepackage[export]{adjustbox}
\usepackage{xltabular}
\renewcommand\tabularxcolumn[1]{m{#1}}

\begin{document}

\begin{landscape}
\begin{xltabular}{\linewidth}{||c|@{\hspace{\imageborder}}0c@{\hspace{\imageborder}}|X|X|X||}
\hhline{|t:=====:t|}
\textit{\textbf{V}}         & \textbf{Photo}                                    & \multicolumn{1}{c|}{\textbf{Specifications}}                                                  & \multicolumn{1}{c|}{\textbf{Pros}}                            & \multicolumn{1}{c||}{\textbf{Cons}}                                               \endfirsthead
\hline
\textit{1}              & \includegraphics[width=2cm, valign=c]{example-image}                              & Spec. 1\newline Moderately long description  & Simple Easy to make and build & Sharp edges\newline Basic                     \\
\hline
\textit{2}              & \includegraphics[width=2cm, valign=c]{example-image-10x16}                                 & Blablabla  blablablablabla       & Blablabla\newline blablablablabla             & Short bla\newline Not working            \\
\hhline{|b:=====:b|}
\caption{Part versioning.}
\label{tab:PartTable}
\end{xltabular}
\end{landscape}

\end{document}

相关内容