如何避免表格占满整个页面?

如何避免表格占满整个页面?

我希望我的表格具有列中文本的大小,而不是像底部示例中那样适合整个页面。有人知道如何解决这个问题吗?

在此处输入图片描述

代码如下:

\documentclass{article}
\usepackage[letterpaper,margin=2.5cm]{geometry}
\usepackage{pdflscape}
\usepackage{xltabular} 
\usepackage{ragged2e}  
\newcolumntype{L}{>{\RaggedRight\hangafter1\hangindent1em}X}
\usepackage{booktabs}
\newlength\mylen
\setlength\mylen{\textheight}

\begin{document}


\begin{xltabular}{\textwidth}{@{} ll @{}}

\caption{xxxxxxxxx xxxxxxxxx xxxxx xxx xxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxxxx xxx xxxxx xxxxxxx xxxxxxxxx xxxxxxxxx xxxxx xxx xxxxx xxxxxxx}
\label{tab:my-table}\\
\toprule
\textbf{xxxxxxxxx} & \textbf{xxxxxxxxx} \\ 
\midrule
\endfirsthead

\multicolumn{2}{@{}p{\textwidth}@{}}
{Table \thetable: xxxxxxxxx xxxxxxxxx xxxxx xxx xxxxx xxxxxxxxxxxxxxxx xxxxxxxxx xxxxx xxx xxxxx xxxxxxx xxxxxxxxx xxxxxxxxx xxxxx xxx xxxxx xxxxxxx (Continued)} \\ \addlinespace[14.4pt]
\toprule
\textbf{xxxxxxxxx} & \textbf{xxxxxxxxx} \\ 
\midrule
\endhead

\bottomrule
\endlastfoot

%% body of table
\multicolumn{2}{@{}l}{\textbf{xxxxxxxxxxx}} \\[0.25ex]
xxxxxxxxxx xxxxxxxxxx xxxx xxxxx xxxxxxxx xxxxxxxxxxxx & zzzz zzzz zzzz \\
xxxxxxx xxxxxxxx xxxxxx xxxxxx xxxxxx xxxxx xxxxx xx & zzzz zzzz zzzz \\
xxxxxxx xxxxxx xxxxxxxxx xxxxxx xxxxxxxxxx xxxxxx & zzzz zzzz zzzz \\
xxxxxxx xxxxxx xxxxxxxxx xxxxxx xxxxxxxxxx xxxxxxxxxxxxx & zzzz zzzz zzzz \\
xxxxxxx xxxxxx xxxxxxxxx xxxxxx xxxxxxxxxx xxxx & zzzz zzzz zzzz \\

\addlinespace 
\multicolumn{2}{@{}l}{\textbf{xxxxxxxxxxxx}} \\[0.25ex]
xxxxxxx xxxxxx xxxxxxxxx xxxxxx xxxxxxxxxx xxxxx & zzzz zzzz zzzz \\
xxxxxx xxxxxx xxxxxxxxxx xxxxxxx & zzzz zzzz zzzz \\
xxxxxxx xxxxxx xxxxxxx & zzzz zzzz zzzz \\
xxxxxxx xxxxxx xxxxxxxxx xxxxxx xxxxxxxx & zzzz zzzz zzzz \\
xxxxxxx xxxxxx xxxxxxxxx xxxxxx xxxxxxxxxx xxxxx & zzzz zzzz zzzz \\
xxxxxx xxxxxx xxxxxxxxxx xxxxxxx & zzzz zzzz zzzz \\

%\hline
\end{xltabular}

\end{document}

相关内容