我的表格两边都超出了页面

我的表格两边都超出了页面

我要制作下表,但它从两边超出了页面,我无法修复它……知道可能是什么问题吗?谢谢

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{array}
\usepackage{booktabs, multirow}
\usepackage{multirow}
\usepackage[center, labelfont=bf]{caption}
\begin{table}[h]
\makebox[\textwidth][c]{
\begin{tabular}{c|c|c|c|c|c|c|p{0.4\linewidth}}
\toprule[1.5pt]
& \textbf{Words} & \textbf{En words} & \textbf{Gr words} & \textbf{Al words} & \textbf{\% En words} & \textbf{\% Gr words} &\textbf{\% Al words}\\
\hline
\textbf{Gr/En Mixes} & 3663 & 2207 & 1456 & kati & 60,3 & 39,7 & kati\\
\hline
\textbf{Gr/Al/En/ Mixes} & 131 & 48 & 51 & 32 & 36,6 & 38,9 & 24,4\\
\hline
\textbf{Gr/Al Mixes} & 35 & kati & 24 & 11 & kati & 68,6 & 31,4\\
\hline
\textbf{Al/En Mixes} & 131 & 72 & kati & 59 & 55,0 & kati & 45,0\\
\hline
\textbf{Total mixes} & 3960 & 2327 & 1531 & 102 & 58,8 & 38,7 & 2,6\\
\bottomrule[1.5pt]
\end{tabular}}
\caption{Table 6: The percentage of words in each set of code mixed sentences.}
\end{table}\

答案1

有一个不错的功能tabularx- 您可以指定表格的宽度。查看下面的示例(我必须放大第一列,因为文本与第二列重叠 - 因此它具有不同的列描述符>{\arraybackslash\advance\hsize3em}X::

\begin{table}[h]
\begin{tabularx}{\textwidth}{>{\arraybackslash\advance\hsize3em}X|X|X|X|X|X|X|X}
\toprule[1.5pt]
& \textbf{Words} & \textbf{En words} & \textbf{Gr words} & \textbf{Al words} & \textbf{\% En words} & \textbf{\% Gr words} &\textbf{\% Al words}\\
\hline
\textbf{Gr/En Mixes} & 3663 & 2207 & 1456 & kati & 60,3 & 39,7 & kati\\
\hline
\textbf{Gr/Al/En Mixes} & 131 & 48 & 51 & 32 & 36,6 & 38,9 & 24,4\\
\hline
\textbf{Gr/Al Mixes} & 35 & kati & 24 & 11 & kati & 68,6 & 31,4\\
\hline
\textbf{Al/En Mixes} & 131 & 72 & kati & 59 & 55,0 & kati & 45,0\\
\hline
\textbf{Total mixes} & 3960 & 2327 & 1531 & 102 & 58,8 & 38,7 & 2,6\\
\bottomrule[1.5pt]
\end{tabularx}
\caption{Table 6: The percentage of words in each set of code mixed sentences.}
\end{table}

相关内容