tabularx 中的垂直断线

tabularx 中的垂直断线
\begin{table}[H]
\begin{center}
\begin{tabularx}{\textwidth}{|Y|Y|l|}
\hline
Name&Frequency Range&Interpretation and Appearance\\ \hline\hline
Delta \delta&0.1 - 3.5 Hz&Deep sleep or unconsciousness.\\
Theta \theta&4 - 7.5 Hz&Decreased consciousness or sleep.\\
Alpha \alpha&8 - 13 Hz&Awake, relaxed, (clinically: awake or eyes closed)\\
Beta \beta  &14 - 30 Hz&Consciously alert, agitated, or tense\\
Gamma \gamma&30 Hz +&Attention, sensory stimulation\\

\hline
\end{tabularx}
\end{center}
\caption[Rhythms of the EEG signal]{Rhythms of the EEG signal.}
\label{tab:1_2}
\end{table}

在此处输入图片描述

答案1

我提出了两种实现方式,在这两种方式中我都使用了siunitx改善措施外观的设施。

\documentclass{article}
\usepackage{geometry} % wider text

\usepackage{siunitx}
\usepackage{tabularx} % for the first instance
\usepackage{booktabs} % for the second instance

\begin{document}

\begin{table}

\begin{tabularx}{\textwidth}{
  |>{\centering}X|
  >{\centering}X|
  l|
}
\hline
Name           & Frequency Range            & Interpretation and Appearance\\
\hline\hline
Delta $\delta$ & \SIrange{0.1}{3.5}{\hertz} & Deep sleep or unconsciousness.\\
Theta $\theta$ & \SIrange{4}{7.5}{\hertz}   & Decreased consciousness or sleep.\\
Alpha $\alpha$ & \SIrange{8}{13}{\hertz}    & Awake, relaxed, (clinically: awake or eyes closed)\\
Beta  $\beta$  & \SIrange{14}{30}{\hertz}   & Consciously alert, agitated, or tense\\
Gamma $\gamma$ & \SI{>30}{\hertz}           & Attention, sensory stimulation\\
\hline
\end{tabularx}

\caption[Rhythms of the EEG signal]{Rhythms of the EEG signal.}
\label{tab:1_2}

\end{table}

\begin{table}

\begin{tabular*}{\textwidth}{
  @{\extracolsep{\fill}}
  |c|
  c|
  l|
  @{}
}
\toprule
Name           & Frequency Range            & Interpretation and Appearance\\
\midrule
Delta $\delta$ & \SIrange{0.1}{3.5}{\hertz} & Deep sleep or unconsciousness.\\
Theta $\theta$ & \SIrange{4}{7.5}{\hertz}   & Decreased consciousness or sleep.\\
Alpha $\alpha$ & \SIrange{8}{13}{\hertz}    & Awake, relaxed, (clinically: awake or eyes closed)\\
Beta  $\beta$  & \SIrange{14}{30}{\hertz}   & Consciously alert, agitated, or tense\\
Gamma $\gamma$ & \SI{>30}{\hertz}           & Attention, sensory stimulation\\
\bottomrule
\end{tabular*}

\caption[Rhythms of the EEG signal]{Rhythms of the EEG signal.}
\label{tab:1_2-improved}

\end{table}

\end{document}

笼中的桌子

在此处输入图片描述

被释放的

在此处输入图片描述

答案2

以下是表格的两个版本:

在此处输入图片描述

\documentclass{article}

\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}

%%%%% Only for the second example %%%%%
\usepackage{booktabs}
\usepackage{calc}
\usepackage{siunitx}
\newlength{\mycolwidth}
\setlength{\mycolwidth}{\widthof{Range in \si{\hertz}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\begin{table}
\centering
\begin{tabularx}{\textwidth}{|Y|Y|l|}
\hline
Name&Frequency Range&Interpretation and Appearance\\ \hline\hline
Delta $\delta$ & 0.1 - 3.5 Hz & Deep sleep or unconsciousness.\\
Theta $\theta$ & 4 - 7.5 Hz   & Decreased consciousness or sleep.\\
Alpha $\alpha$ & 8 - 13 Hz    & Awake, relaxed, (clinically: awake or eyes closed)\\
Beta  $\beta$  & 14 - 30 Hz   & Consciously alert, agitated, or tense\\
Gamma $\gamma$ & 30 Hz +      & Attention, sensory stimulation\\
\hline
\end{tabularx}
\caption[Rhythms of the EEG signal]{Rhythms of the EEG signal.}
\label{tab:1_2}
\end{table}

\begin{table}
\centering
\begin{tabularx}{\textwidth}{l>{\raggedleft\arraybackslash}p{0.5\mycolwidth-0.5\tabcolsep}@{--}>{\raggedright\arraybackslash}p{0.5\mycolwidth-0.5\tabcolsep}X}
\toprule
Name           & \multicolumn{2}{c}{Frequency}    & Interpretation and Appearance                      \\
               & \multicolumn{2}{c}{Range  in Hz} &                                                    \\ 
\midrule
Delta $\delta$ & 0.1 & 3.5  & Deep sleep or unconsciousness.                     \\
Theta $\theta$ & 4   & 7.5    & Decreased consciousness or sleep.                  \\
Alpha $\alpha$ & 8   & 13     & Awake, relaxed, (clinically: awake or eyes closed) \\
Beta  $\beta$  & 14  & 30    & Consciously alert, agitated, or tense              \\
Gamma $\gamma$ & \multicolumn{2}{c}{\textgreater 30}     & Attention, sensory stimulation                     \\
\bottomrule
\end{tabularx}
\caption[Rhythms of the EEG signal]{Rhythms of the EEG signal.}
\label{tab:1_2}
\end{table}
\end{document}

相关内容