请帮我解决表格问题

请帮我解决表格问题

在此处输入图片描述

上表来自C. Bonatto 和 E. Bica:M 52 和 NGC 3960 的基本参数

\documentclass[a4paper,oneside,12pt]{report}
\begin{document}
\begin{small}
%\begin{sidewaystable}[h]
\begin{table}[htp]
%\restylefloat{table}
 \centering\small\setlength\tabcolsep{3pt}

%\centering \footnotesize\setlength{\tabcolsep}{0.5pt}
%\toprule
\hspace*{0cm}\begin{tabular}{l@{\hspace{3pt}} *{15}{c}}

%\begin{tabular}{l@{\hspace{1pt}} *{12}{c}}
\hline
\hline

%\bfseries cluster&
\multicolumn{6}{c}{\bfseries previous study}&
\multicolumn{6}{c}{\bfseries present study}\\

         \hline
clusters & $RA_{J2000}$ &$DEc_{J2000}$& $r_{core}$& $r_{lim}$ & $\log(age)$&E$(B-V)$&d&$RA_{J2000}$&$DEc_{J2000}$& $r_{core}$& $r_{lim}$ &$\log(age)$&E$(B-V)$&d\\
          &        &(hms)&(dms)& (arcmin)&(arcmin)&(year)&(mag)&(Kpc)&(hms)&(dms)&(arcmin)&(arcmin)& (year)&(mag)&(Kpc)\\
         \hline
\bfseries Berkeley 53
         &$20 55 56$&$+51 02.8$& $2.5\pm0.1$&$\simeq 20$&$9.09\pm0.02$&$1.52\pm0.01$&$3.1\pm0.1$
         &              &               & $4.19\pm0.28$ &$20\pm1.6$ &$9.10\pm0.05$  &$1.39\pm0.42$&$3240\pm440$\\
\hline
\hline
%\toprule
\end{tabular}\hspace*{0cm}
\caption{astrophysical parameters obtained from ischrone fitting}\label{tab:comber}
%\end{sidewaystable}
\end{table}
\end{small}
\end{document}

在此处输入图片描述

我想要像图片那样的桌子。

答案1

有很多方法可以将其设置为横向显示,但下面的方法至少可以使其适合页面。(顺便说一句,它对于横向显示来说也太大了。)

\documentclass[a4paper,oneside,12pt]{report}
\usepackage{graphics}% for \resizebox

\begin{document}

%\begin{sidewaystable}[h]
\begin{table}[htp]
%\restylefloat{table}
 \centering\small\setlength\tabcolsep{3pt}

%\centering \footnotesize\setlength{\tabcolsep}{0.5pt}
%\toprule
\resizebox{\textwidth}{!}{% fit on page
\begin{tabular}{l@{\hspace{3pt}} *{15}{c}}

%\begin{tabular}{l@{\hspace{1pt}} *{12}{c}}
\hline
\hline

%\bfseries cluster&
& \multicolumn{7}{l}{\parbox{5in}%
  {\centering\textbf{previous study}\\
  \rule[.6\baselineskip]{5in}{.5pt}}}
& \multicolumn{7}{l}{\parbox{5in}%
  {\centering\textbf{present study}\\
  \rule[.6\baselineskip]{5in}{.5pt}}}
\vspace{-5pt}\\
clusters & $RA_{J2000}$ &$DEc_{J2000}$& $r_{core}$& $r_{lim}$ & $\log(age)$&E$(B-V)$&d&$RA_{J2000}$&$DEc_{J2000}$& $r_{core}$& $r_{lim}$ &$\log(age)$&E$(B-V)$&d\\
          &        &(hms)&(dms)& (arcmin)&(arcmin)&(year)&(mag)&(Kpc)&(hms)&(dms)&(arcmin)&(arcmin)& (year)&(mag)&(Kpc)\\
\hline
\bfseries Berkeley 53
         &$20 55 56$&$+51 02.8$& $2.5\pm0.1$&$\simeq 20$&$9.09\pm0.02$&$1.52\pm0.01$&$3.1\pm0.1$
     &              &               & $4.19\pm0.28$ &$20\pm1.6$ &$9.10\pm0.05$  &$1.39\pm0.42$&$3240\pm440$\\
\hline
\hline
%\toprule
\end{tabular}}
\caption{astrophysical parameters obtained from ischrone fitting}\label{tab:comber}
%\end{sidewaystable}
\end{table}
\end{document}

桌子

答案2

这是一个可能的解决方案,其中添加了标签 (1) 至 (15) 以进行清理。此解决方案认为 cfr 和 torbjorn 等用户给出了正确的方向,此外,两个研究类别之间的差距(此处显示为 (A)、B、C)也存在问题。总共有 16 列,分组multicolumn也是错误来源之一。

注意:移除(A)、B、C 将得到正确的间隙。此处它们充当参考的灯塔。

在此处输入图片描述

代码

\begin{document}

%\begin{sidewaystable}[h]
\begin{table}[!htp]
%\restylefloat{table}
 \centering\small\setlength\tabcolsep{3pt}

%\centering \footnotesize\setlength{\tabcolsep}{0.5pt}
%\toprule
\hspace*{0cm}
\caption{astrophysical parameters obtained from ischrone fitting}\label{tab:comber}
\begin{tabular}{l@{\hspace{3pt}} *{15}{c}}
%\begin{tabular}{l@{\hspace{1pt}} *{12}{c}}
\hline
\hline
%\bfseries cluster
&
\multicolumn{7}{c}{\bfseries Previous study}&&
\multicolumn{7}{c}{\bfseries Present study}\\
\cline{2-8}\cline{10-16}
clusters & $RA_{J2000}$ &$DEc_{J2000}$& $r_{core}$& $r_{lim}$ & $\log(age)$&E$(B-V)$&d&&$RA_{J2000}$&$DEc_{J2000}$& $r_{core}$& $r_{lim}$ &$\log(age)$&E$(B-V)$&d\\
        &(hms)&(dms)& (arcmin)&(arcmin)&(year)&(mag)&(Kpc)&&(hms)&(dms)&(arcmin)&(arcmin)& (year)&(mag)&(Kpc)\\
(1)&(2)&(3)&(4)&(5)&(6)&(7)&(8)&(A) &(9)&(10)&(11)&(12)&(13)&(14)&(15)\\
         \hline
\bfseries Berkeley 53
         &$20 55 56$ &$+51 02.8$ & $2.5\pm0.1$    &$\simeq 20$ &$9.09\pm0.02$  &$1.52\pm0.01$ &$3.1\pm0.1$&B
         &                  &                  & $4.19\pm0.28$ &$20\pm1.6$ &$9.10\pm0.05$  &$1.39\pm0.42$ &$3240\pm440$\\
         \hline
\bfseries Berkeley 53
         &$20 55 56$&$+51 02.8$& $2.5\pm0.1$&$\simeq 20$&$9.09\pm0.02$&$1.52\pm0.01$&$3.1\pm0.1$         &C
         &              &               & $4.19\pm0.28$ &$20\pm1.6$ &$9.10\pm0.05$  &$1.39\pm0.42$&$3240\pm440$\\
\hline
\hline
%\toprule
\end{tabular}\hspace*{0cm}
%\end{sidewaystable}
\end{table}
\end{document}

答案3

压缩表格

你可以这样做。我不推荐这样做,但这是可行的。

\documentclass[a4paper,oneside,10pt]{report}
\usepackage{booktabs}
\usepackage[hscale=.925]{geometry}
\begin{document}

\begin{table}[htp]

 \centering\scriptsize\setlength\tabcolsep{.25pt}

\noindent\begin{tabular}{l*{15}{c}}
\toprule
\multicolumn{6}{c}{\bfseries previous study} & \multicolumn{6}{c}{\bfseries present study}\\\midrule
clusters & $RA_{J2000}$ &$DEc_{J2000}$& $r_{core}$& $r_{lim}$ & $\log(age)$&E$(B-V)$&d&$RA_{J2000}$&$DEc_{J2000}$& $r_{core}$& $r_{lim}$ &$\log(age)$&E$(B-V)$&d\\
          &        &(hms)&(dms)& (arcmin)&(arcmin)&(year)&(mag)&(Kpc)&(hms)&(dms)&(arcmin)&(arcmin)& (year)&(mag)&(Kpc)\\\midrule
\bfseries Berkeley 53
         &$20 55 56$&$+51 02.8$& $2.5\pm0.1$&$\simeq 20$&$9.09\pm0.02$&$1.52\pm0.01$&$3.1\pm0.1$
         &              &               & $4.19\pm0.28$ &$20\pm1.6$ &$9.10\pm0.05$  &$1.39\pm0.42$&$3240\pm440$\\
\bottomrule
\end{tabular}
\caption{astrophysical parameters obtained from ischrone fitting}\label{tab:comber}
\end{table}

\end{document}

相关内容