有没有办法使用表格或其他方法来创建一个可扩展以使用整个可用空间的表?如果我创建一个有 4 行的表,那么每行将使用 25% 的空间。谢谢!
答案1
可能\usepackage{tabularx}
\begin{tabularx}{\textwidth}{ XXXX }
\hline
label 1 & label 2 & label 3 & label 4 \\
\hline
item 1 & item 2 & item 3 & item 4 \\
\hline
\end{tabularx}
我修改了代码以添加垂直空间
\documentclass{article}
\usepackage{tabularx}
\begin{document}
\newcommand\myvspace [2]{ \vrule width0pt height#1 depth#2}
\begin{tabularx}{\textwidth}{ XXXX }
\hline
\myvspace{1cm}{1cm} label 1 & label 2 & label 3 & label 4 \\
\hline
\myvspace{2cm}{2cm}\begin{minipage}{2cm}
this is a long text and I need some place
\end{minipage}
& item 2 & item 3 & item 4 \\
\hline
\end{tabularx}
\end{document}
答案2
我不确定我是否理解得正确:
\vbox to\vsize{\everycr={\noalign{\vskip 2pt plus 1\vsize}}
\halign to\hsize{&#\hfil\tabskip=1em plus 1\hsize\cr
Sup? & These & are & going & to & space & out \cr
Likewise & for & the & rows & which & are \cr
Going & to & space & out & trying & to \cr
fill & out & the & page \cr
}
}
\bye