如您所见,我遇到的问题是我的文本超出了边距。我想要的是这样的
其中框的宽度与双栏格式的列一样宽,并且框内的文本也会自动换行。
编辑:我的代码如下所示
\begin{table}[ht]
%\caption{Nonlinear Model Results} % title of Table
% used for centering table
\begin{tabular}{c} % centered columns (4 columns)
\hline %inserts double horizontal lines
\textbf{The protocol} \\ [0.5ex] % inserts table
%heading
\hline % inserts single horizontal line
\centering
\begin{enumerate}
\item Draw a random sequence of \textbf{G} = $\{U_{r}\}_{r=1,...,|\textbf{G}|}$ that what about with more words
\end{enumerate}
& 50 & 837 & 970 \\ [1ex]% inserting body of the table % [1ex] adds vertical space
\hline %inserts single line
\end{tabular}
\label{table:nonlin} % is used to refer this table in the text
\end{table}
答案1
第一部分——无溢出
\documentclass[11pt]{article}
\usepackage{blindtext}
\usepackage{showframe}
\renewcommand*\ShowFrameColor{\color{red}}
\renewcommand{\arraystretch}{1.2}
\begin{document}
\phantom{~}
\begin{tabular}{{p{0.1\textwidth}p{0.75\textwidth}}}
\hline
First column&Second column\\
\hline
abcd&\blindtext\\
efgh&ijkl\\
\hline
\end{tabular}
\end{document}
第二部分——有溢出
\documentclass[11pt]{article}
\usepackage{blindtext}
\usepackage{showframe}
\renewcommand*\ShowFrameColor{\color{red}}
\renewcommand{\arraystretch}{1.2}
\begin{document}
\phantom{~}
\begin{tabular}{ll}
\hline
First column&Second column\\
\hline
abcd&\blindtext\\
efgh&ijkl\\
\hline
\end{tabular}
\end{document}
这应该符合要求