改善表格的外观

改善表格的外观

我有这张桌子

{\scriptsize

    \begin{longtable}{p{3.5cm}p{4cm}p{4cm}}
    \caption{word frequrnt} \label{tab:addlabeloooo} \\
     \\ [0.1cm]
     \hline
    Metric& Brown vs. LOB   &Brown vs. King James Bible\\[0.1cm]
    \hline 
    Average codelength  & 0.84  & 1.84 \\[0.1cm]
    Top1 unigram & 7.65  & 10.52 \\[0.1cm]
    Top5 unigram & 6.94  & 10.05 \\[0.1cm]
    Top10 unigram & 6.38  & 9.72 \\[0.1cm]
    Top100 unigram & 4.88  & 7.54 \\[0.1cm]
    Top1 bigram & 8.52  & 11.25 \\[0.1cm]
    Top5 bigram & 6.68  & 10.23 \\[0.1cm]
    Top10 bigram & 5.94  & 9.38 \\[0.1cm]
    Top100 bigram & 4.17  & 7.19 \\[0.1cm]
    Top1 trigram & 5.4   & 9.56 \\[0.1cm]
    Top5 trigram & 4.77  & 8.68 \\[0.1cm]
    Top10 trigram & 4.6   & 8.17 \\[0.1cm]
    Top100 trigram & 3.58  & 6.3 \\[0.1cm]
    \% of words in 1st corpus not in 2nd corpus &6.05  & 8.73 \\[0.1cm]
    \% of words in 2nd corpus not in 1st  corpus & 5.54  & 2.94 \\[0.1cm]
    Top 10 unseen words in 1st corpus & Mr. Mrs. Dr. Mr SIC J. St. Colour Fig. R. & LORD Shalt and was are hast Is Were be \\[0.1cm]
    Top 10 unseen words in 2nd  corpus & Mr\& **f Mrs\& **h Program Dr\& <The **f. Center St\& & Has Mr\& American Mrs\& Around during United Does don't didn't \\[0.1cm] \hline
    \end{longtable}
    }

但它看起来很丑,因为有一些像图片中的长线这

有人知道如何改善它的外观吗?

答案1

您确实不应该将如此不同的值类型放入同一列中。我至少会将其拆分成三个表。无论如何,一些小改进……

\documentclass{scrartcl}
\usepackage{booktabs,multirow,siunitx}
\newcommand*{\gram}[1]{{$\langle$#1$\rangle$}}
\begin{document}
\begin{table}
\begin{tabular}{p{0.25\textwidth}%
               *2{S[table-format=2.2,table-space-text-post={\,\%}]}}
\toprule
Metric & {Brown vs. LOB} & {Brown vs. KJB} \\
\midrule
Average codelength & 0.84  &  1.84 \\
\midrule
Top1   unigram & 7.65  & 10.52 \\
Top5   unigram & 6.94  & 10.05 \\
Top10  unigram & 6.38  &  9.72 \\
Top100 unigram & 4.88  &  7.54 \\
Top1    bigram & 8.52  & 11.25 \\
Top5    bigram & 6.68  & 10.23 \\
Top10   bigram & 5.94  &  9.38 \\
Top100  bigram & 4.17  &  7.19 \\
Top1   trigram & 5.40  &  9.56 \\
Top5   trigram & 4.77  &  8.68 \\
Top10  trigram & 4.60  &  8.17 \\
Top100 trigram & 3.58  &  6.30 \\
\midrule
Words in 1st, not in 2nd corpus & 6.05\,\%  & 8.73\,\% \\
Words in 2nd, not in 1st corpus & 5.54\,\%  & 2.94\,\% \\
\midrule
Top 10 unseen words in 1st corpus 
& \multicolumn1{p{0.33\textwidth}}{\gram{Mr.} 
  \gram{Mrs.} \gram{Dr.} \gram{Mr} \gram{SIC} 
  \gram{J.} \gram{St.} \gram{Colour} \gram{Fig.} \gram{R.}} 
& \multicolumn1{p{0.33\textwidth}}{\gram{LORD} 
  \gram{Shalt} \gram{and} \gram{was} \gram{are} 
  \gram{hast} \gram{Is} \gram{Were} \gram{be}} \\
Top 10 unseen words in 2nd corpus
& \multicolumn1{p{0.33\textwidth}}{\gram{Mr\&} 
  \gram{**f} \gram{Mrs\&} \gram{**h} \gram{Program} 
  \gram{Dr\&} \gram{<The} \gram{**f.} \gram{Center} \gram{St\&}}
& \multicolumn1{p{0.33\textwidth}}{\gram{Has} 
  \gram{Mr\&} \gram{American} \gram{Mrs\&} 
  \gram{Around} \gram{during} \gram{United} 
  \gram{Does} \gram{don't} \gram{didn't}} \\
\bottomrule
\end{tabular}
\caption{Comparison} \label{tab:comparison}
\end{table}
\end{document}

相关内容