表格调整大小问题

表格调整大小问题

在此处输入图片描述

我遇到了宽度(表格大小)问题。我希望第二张表格的宽度与第一张相同。请帮我解决这个问题。谢谢

第二表的代码是:

\begin{table}[]
\begin{tabular}{|l|l|l|}
\hline
\textbf{ID} & \textbf{Priority} & \textbf{Details}                                                                                                                                                                                   \\ \hline
NR-01-001   & 1                 & Delivery: The system development process and deliverable documents shall conform to the process and deliverables dened in document \textbackslash{}CIIT-CE-02H DegreeProject Student's Handbook". \\ \hline
NR-01-002   & 1                 & Standard: The standard of the final product shall be of undergraduate level or above.                                                                                                            \\ \hline
\end{tabular}
\end{table}

答案1

我建议你改用tabularx简单的tabular。它的X(以及从它派生的)列类型可以自动确定列宽,并且,在你的情况下重要的是,将文本分成多行:

\documentclass{article}
\usepackage{tabularx}

%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}% For dummy text. Don't use in a real document


\begin{document}
\lipsum[1][1-2]
    \begin{table}[ht]
\begin{tabularx}{\linewidth}{|l|l|X|}
    \hline
\textbf{ID} & \textbf{Priority} 
                    & \textbf{Details}  \\ 
    \hline
NR-01-001   & 1     & Delivery: The system development process and deliverable documents shall conform to the process and deliverables dened in document \textbackslash{}CIIT-CE-02H DegreeProject Student's Handbook". \\
    \hline
NR-01-002   & 1     & Standard: The standard of the final product shall be of undergraduate level or above.     \\
    \hline
\end{tabularx}
    \end{table}
\end{document}

在此处输入图片描述

(红线表示文本边框)

相关内容