我到目前为止有这个代码
\begin{table}[htbp]
\centering
\begin{tabular}{r|l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}}
\multicolumn{5}{l}{}\\
LO &12 &12\\ \hline
4 &0\\
5 &9\\
6 &0\\
7 &2 &5 &9 &9\\
8 &4 &7\\
9 &1 &4 &4 &5 &9\\
10 &0 &1 &3 &9\\
11 &1 &9 &9\\
12 &7\\
13 &1 &4\\
14 &1\\ \hline
HI &172
\end{tabular}
\caption*{$ n=28\ 1|2 $ represents £1.20}
\end{table}
然后给了我
我怎样才能去除 LO 和 HI 旁边的水平线并整理间距?
任何帮助都将不胜感激,因为我刚刚学习如何使用乳胶
答案1
\documentclass{article}
\usepackage{array}
\usepackage{caption}
\begin{document}
\begin{table}[htbp]
\centering
\begin{tabular}{r|l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}l@{\hspace{4 pt}}}
\multicolumn{1}{c}{LO} &\rlap{12 12}\\ \hline
4 &0\\
5 &9\\
6 &0\\
7 &2 &5 &9 &9\\
8 &4 &7\\
9 &1 &4 &4 &5 &9\\
10 &0 &1 &3 &9\\
11 &1 &9 &9\\
12 &7\\
13 &1 &4\\
14 &1\\ \hline
\multicolumn{1}{c}{HI} &\rlap{172}
\end{tabular}
\caption*{$ n=28\ 1|2 $ represents £1.20}
\end{table}
\end{document}
答案2
那么下面呢?
\documentclass{article}
\usepackage{caption}
\begin{document}
\begin{table}[htbp]
\centering
\setlength{\tabcolsep}{4pt}
\begin{tabular}{rr|llllll}
& \multicolumn{5}{l}{}\\
& \multicolumn{1}{r}{LO} & \multicolumn{5}{l}{12 \hspace{\tabcolsep} 12} \\ \cline{2-7}
& 4 &0\\
& 5 &9\\
& 6 &0\\
& 7 &2 &5 &9 &9\\
& 8 &4 &7\\
& 9 &1 &4 &4 &5 &9\\
& 10 &0 &1 &3 &9\\
& 11 &1 &9 &9\\
& 12 &7\\
& 13 &1 &4\\
& 14 &1\\ \cline{2-7}
& \multicolumn{1}{r}{HI} & \multicolumn{6}{l}{172} \\[0.25cm]
\multicolumn{2}{r|}{n=28 1} & \multicolumn{6}{l}{2 represents £1.20}
\end{tabular}
\end{table}
\end{document}