这张表有什么问题?

这张表有什么问题?

下表中的间距不合适。如何调整?

\documentclass{article}
\begin{document}
\begin{table}
\centering
\begin{tabular}{p{0.3\textwidth}p{0.3\textwidth}p{0.4\textwidth}}
  \hline
  \textbf{Metric} & \textbf{Formula} & \textbf{Explanation} \\
  \hline
  Execution Time & $N\cdot\sum_{i=1}^{n}{t_i}$ & The total time taken by the IVR system to resolve a query of the user \\
  Precision & max($\frac{a_1}{b_1}$,$\frac{a_2}{b_2}$,...,$\frac{a_n}{b_n}$) & The measure of relevant information generated by the IVR system for the user \\
  Semantic Delay & $\frac{r_o}{t_o}$ & Time taken by the IVR system to explore the ontology  \\
  \hline
\end{tabular}
\caption{Evaluation Metrics}
\label{tab:evaluation}
\end{table}
\end{document}

答案1

在某些情况下,内核提供的行很丑陋。包booktabs可以解决这个问题。

在较窄的列中(例如表格列),最好不是使文本美观并且排版整齐。

\documentclass{article}
\usepackage{booktabs}
\usepackage{array}
\usepackage{caption}
\usepackage{showframe}
\captionsetup[table]{position=above}
\newcommand{\tableheadfont}{\bfseries}
\newcolumntype{R}[1]{>{\raggedright\arraybackslash}p{#1}}
\begin{document}
\begin{table}
    \centering
    \caption{Evaluation Metrics}
    \label{tab:evaluation}
    \begin{tabular}{p{0.27\textwidth}p{0.27\textwidth}R{0.33\textwidth}}
        \toprule
        \bfseries Metric & \bfseries Formula &
        \bfseries Explanation \\
        \midrule
        Execution Time &
        $N\cdot\sum_{i=1}^{n}{t_i}$ & The total
        time taken by the IVR system to resolve a
        query of the user \\
        Precision &
        max($\frac{a_1}{b_1}$,$\frac{a_2}{b_2}$,\dots,$\frac{a_n}{b_n}$)
        & The measure of relevant information
        generated by the IVR system for the
        user \\
        Semantic Delay & $\displaystyle\frac{r_o}{t_o}$ &
        Time taken by the IVR system to
        explore the ontology  \\
        \bottomrule
    \end{tabular}
\end{table}
\end{document}

相关内容