請幫我解決一個表格問題

請幫我解決一個表格問題

在此輸入影像描述

上表來自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}

相關內容