特克斯代码:
\documentclass[a4paper,11pt]{article}
\usepackage{tabularx}
\usepackage{tabularray}
\usepackage{float}
\begin{document}
\begin{table}[H]
{\renewcommand{\arraystretch}{1.3}%
\centering
\small
\begin{tabularx}\linewidth{ |c|l|p{2cm}|p{2cm}|X|}
\hline
\multicolumn{1}{|c|}{} & \multicolumn{3}{|c|}{Criteria}
\hline
\parbox[t]{2mm}{\multirow{3}{*}{\rotatebox[origin=c]{90}{Stats}}} \\ & text & text & text & text \\
\hline
Respect & Stamina & Muscle & Fat & Sex appeal \hline
\end{tabularx}
}
\end{table}
\end{document}
电流输出:
期望输出:
我想要的是期望的输出。但是,我无法理解 LaTeX 中的表格。第二个示例是近似的,因为我是在 Paint 中绘制的。但是,我希望统计数据像这样显示,然后有很多行和列也这样显示。
答案1
\documentclass[a4paper,11pt]{article}
\usepackage{tabulary,multirow,array}
\usepackage{lipsum}
\usepackage{graphicx}
\begin{document}
\lipsum[1][1-6]
\tymax=\linewidth
\noindent
\begin{tabulary}{\linewidth}{|C|L|L|L|L|}\cline{2-5}
\multicolumn{1}{c|}{} & \multicolumn{4}{c|}{Criteria} \\\cline{2-5}
\multicolumn{1}{c|}{} & \centering A & \centering B & \centering C & D \\\hline
\multirow{10}{=}{\rotatebox[origin=c]{90}{Stats}} &
\lipsum[1][1] &
\lipsum[2][1] &
\lipsum[3][1] &
\lipsum[4][1]\\\cline{2-5}
& & & \\\cline{2-4}
& & \\\cline{2-3}
& \\\cline{2-2}
& \\\cline{2-2}
& \\\cline{2-2}
& \\\cline{2-2}
& \\\cline{2-2}
& \\\cline{2-2}
& \\\cline{2-2}
& \\\cline{1-2}
\end{tabulary}
\end{document}
答案2
含tabularray
包装:
\documentclass[a4paper,11pt]{article}
\usepackage{rotating}
\usepackage{makecell}
\usepackage{tabularray}
\begin{document}
\begin{table}[ht]
\renewcommand\theadfont{\bfseries}
\settowidth\rotheadsize{\theadfont stats }
\begin{tblr}{colspec={Q[c, m] *{4}{X[c]}},
row{1,2} = {font=\bfseries},
cell{1}{1} = {r=2}{},
cell{1}{2} = {c=4}{},
cell{3}{1} = {r=4}{cmd=\rothead},
hline{1,2} = {2-Z}{},
hline{3,4} = {},
hline{5} = {1-4}{},
hline{6} = {1-3}{},
hline{Z} = {1-2}{},
%
vline{1} = {3-6}{},
vline{2,3} = {},
vline{4} = {1-5}{},
vline{5} = {1-4}{},
vline{6} = {1-3}{},
}
& Criteria \\
& Respect & Stamina & Muscle & Sex appeal \\
Stats & & & & \\
& & & & \\
& & & & \\
& & & & \\
\end{tblr}
\end{table}
\end{document}
答案3
与。{NiceTabular}
nicematrix
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{c>{\NotEmpty}w{c}{18mm}*{3}{w{c}{18mm}}}[hvlines,corners]
& \Block{1-4}{Criteria} \\
& Respect & Stamina & Muscle & Sex appeal \\
\Block{*-1}{\rotate Stats}& & \NotEmpty & \\
& \\
& \\
& \\
& \\
& \\
& \\
& \\
& \\
& \\
\end{NiceTabular}
\end{document}
您需要进行多次编译(因为nicematrix
在后台使用了 PGF/TikZ 节点)。