LaTeX中的表:使用两列模板将表对齐到单列中

问题描述 投票:0回答:1

我正在研究LaTeX的背面。我正在使用IEEE访问模板,这是两列。我必须在一个列中修复我的表。我必须把桌子固定在它的位置。我为此使用过\FloatBarrier\FloatBarrier已将桌子固定在其位置上,但桌子上覆盖了文字。我已经应用了所有的技术,比如使用Table*!htbp\FloatBarrier等等。我将非常感谢解决这个问题。

\FloatBarrier
\begin{table}[!htbp]
\caption{Car Database}
\label{table:Car_DB}
\begin{tabular}{ccccc}
\toprule
\textbf{Car\_ID}    & \textbf{Car\_Name}    & \textbf{Car\_Number} &\textbf{Owner\_Name}  &\textbf{Owner\_ID} \\
\midrule
C1      &Suzuki Mehran  &RIZ 3725  &Bilal Khalid  &34512-4520645-5\\
C2      &mazda  &MN 3909  &Usman Bhatti  &32103-9963008-2\\
C2      &Toyotta Carolla    &LEL 06 4520  &Ali Haider  &12345-1529307-7\\
\bottomrule
\end{tabular}
\end{table}

The result of this code is like this

latex tabular pdflatex latex-environment biblatex
1个回答
1
投票

我建议减少列标题,因为你的\caption已经提到的项目将与相关/代表汽车。也就是说,删除Car前缀。然后你还可以减少每列之间插入的\tabcolsep

\setlength{\tabcolsep}{0.7\tabcolsep}

上面的命令将\tabcolsep减少了30%。这是最终结果的显示:

enter image description here

\documentclass{IEEEtran}

\usepackage{lipsum,booktabs}

\begin{document}

\begin{table}
  \caption{Car Database}
  \begin{tabular}{ccccc}
    \toprule
    \textbf{Car\_ID}    & \textbf{Car\_Name}    & \textbf{Car\_Number} &\textbf{Owner\_Name}  &\textbf{Owner\_ID} \\
    \midrule
    C1 & Suzuki Mehran   & RIZ 3725    & Bilal Khalid & 34512-4520645-5 \\
    C2 & Mazda           & MN 3909     & Usman Bhatti & 32103-9963008-2 \\
    C3 & Toyotta Carolla & LEL 06 4520 & Ali Haider   & 12345-1529307-7 \\
    \bottomrule
  \end{tabular}
\end{table}

\begin{table}
  \caption{Car Database}
  \setlength{\tabcolsep}{0.7\tabcolsep}% Shrink \tabcolsep by 30%
  \centering
  \begin{tabular}{ *{5}{c} }
    \toprule
    \textbf{ID} & \textbf{Name} & \textbf{Number} & \textbf{Owner name} & \textbf{Owner ID} \\
    \midrule
    C1 & Suzuki Mehran   & RIZ 3725    & Bilal Khalid & 34512-4520645-5 \\
    C2 & Mazda           & MN 3909     & Usman Bhatti & 32103-9963008-2 \\
    C3 & Toyotta Carolla & LEL 06 4520 & Ali Haider   & 12345-1529307-7 \\
    \bottomrule
  \end{tabular}
\end{table}

\sloppy % Just for this example
\lipsum[1]

\end{document}

My table doesn't fit; what are my options?提供更多选项

© www.soinside.com 2019 - 2024. All rights reserved.