我的桌子超出了页面范围

我的桌子超出了页面范围

我的表格超出了页面范围。请给我一个解决方案?

\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{|l|l|l|l|l|l|l|l|l|l|}
\hline
Ref      & \multicolumn{6}{l|}{Model Used}        & Approach                                   & Limitation                                                                                                       & Goal                                                                                                             \\ \hline
         & MBTI & FFM & BFI & KTS & BTR & NEO-FFI & \multicolumn{3}{l|}{}                                                                                                                                                                                                                                                            \\ \hline
{[}10{]} &      &     &     &     &     &         & Interactive personality profiling appraoch & \begin{tabular}[c]{@{}l@{}}Test were based on subjective evidences which\\ may lead to uncertainty.\end{tabular} & \begin{tabular}[c]{@{}l@{}}In order to propose a structure for effective\\ software team structure.\end{tabular} \\ \hline
         &      &     &     &     &     &         &                                            &                                                                                                                  &                                                                                                                  \\ \hline
\end{tabular}
\end{table}

答案1

您需要在第 8、9 和 10 列中允许(更多)换行符。不要手动应用换行符,而是使用环境tabularx并让 LaTeX 完成查找和插入合适换行符的繁琐工作。

以下代码和屏幕截图显示了两种不同的解决方案。两者都采用了tabularx环境。前者使用了大量垂直线,因此请模仿您的方法;第二种方法是省略所有垂直线,并使用较少但间距适当的水平线,从而使表格看起来更“开放”。

在此处输入图片描述

\documentclass{article}
\usepackage{geometry,tabularx,ragged2e,booktabs}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\usepackage[skip=0.333\baselineskip]{caption}

\begin{document}
\begin{table}[htbp]

\caption{Lots of vertical rules}  \label{tab:a}
\begin{tabularx}{\textwidth}{|*{7}{l|} *{3}{L|}}
\hline
Ref & \multicolumn{6}{c|}{Model Used}
    & Approach & Limitation & Goal \\
\hline
& MBTI & FFM & BFI & KTS & BTR & NEO-FFI 
& \multicolumn{3}{l|}{} \\ 
\hline
[10] & & & & & & 
& Interactive personality profiling approach 
& Test were based on subjective evidences which may lead to uncertainty.
& In order to propose a structure for effective software team structure. \\
\hline
& & & & & & & & & \\ 
\hline
\end{tabularx}

\vspace{1cm}
\caption{No vertical rules} \label{tab:b}
\begin{tabularx}{\textwidth}{@{} *{7}{l} *{3}{L} @{}}
\toprule
Ref & \multicolumn{6}{c}{Model Used}
    & Approach & Limitation & Goal \\
\cmidrule(lr){2-7}
& MBTI & FFM & BFI & KTS & BTR & NEO-FFI \\
\midrule 
{[}10] & & & & & &
& Interactive personality profiling approach
& Tests were based on subjective evidence, which may lead to uncertainty
& Propose a structure for effective software team structure \\
\addlinespace
{[}11]  \\
\bottomrule
\end{tabularx}

\end{table}
\end{document}

相关内容