如何制作文本垂直显示的表格?

如何制作文本垂直显示的表格?

我希望我的表格如图所示。在 Latex 中可以实现吗?如果可以,该怎么做?图中显示文本在表格中垂直书写。

答案1

你可以尝试一下

\documentclass{article}

\usepackage{rotating}
\usepackage{multirow}
\usepackage{geometry}

\begin{document}

\begin{tabular}{|c|c|c|c|c|c|}\hline
\multicolumn{4}{|c|}{ \multirow{2}{2cm}{\textbf{Elements} }  } & \textbf{percentage} & \textbf{Additional}\\ 
\multicolumn{4}{|c|}{} & \textbf{(in \%)} & \textbf{Information} \\ \hline
 & & & & & \\
\multirow{24}{0.5cm}{\begin{sideways}Elements\end{sideways}}&\multirow{21}{0.5cm}{\begin{sideways}Non-metals\end{sideways}}&\multirow{6}{0.5cm}[3 mm]{\begin{sideways}Nonbio\end{sideways}}&E1.1& 1 &  \\ 
 & & & & & \\ \cline{4-6}
 & & & & & \\ 
 &  & &E1.2& 2 & \\  
 & & & & & \\ \cline{3-6}
 & & & & & \\
 &  &\multirow{13}{0.5cm}{\begin{sideways}Biodegradable\end{sideways}} &E1.3& 3 & \\ 
 & & & & & \\ \cline{4-6}
 & & & & & \\
 &  & &E1.4& 4 & \\ 
 & & & & & \\ \cline{4-6}
 & & & & & \\
 &  & &E1.5& 5 & \\ 
 & & & & & \\ \cline{4-6}
 & & & & & \\
 &  & &E1.6& 6 & \\ 
 & & & & & \\ \cline{4-6}
 & & & & & \\
 &  & &E1.7& 7 & \\ 
 & & & & & \\ \cline{2-6}
 & &\multicolumn{2}{c|}{} & &  \\
 & \begin{sideways}Metals\end{sideways} & \multicolumn{2}{c|}{Others} & 8 & \\ 
 & & \multicolumn{2}{c|}{}  & & \\ \hline
 \end{tabular}

 \end{document}

在此处输入图片描述

如果您在最后一列中添加信息,可能会遇到一些问题。也许您可以使用其他环境,例如tabulary,但在这个环境中我遇到了问题。

相关内容