3

I want to add text beside the \hline line in order to structure my table more accurately. The following picture illustrates what I want, the code represents the table. Anyone has some ideas? I'd appreciate a lot.

enter image description here

\begin{table}[htbp]\centering
    \renewcommand{\arraystretch}{1.3}
    \caption[..]{..} \label{tab:trigger}

    \begin{tabular}{l | r}  

    \multicolumn{1}{c|}{\textbf{PARAMETER}}     &   \multicolumn{1}{c}{\textbf{VALUE}}      \\ 
    \hline \hline

    STA window                  &       $\SI{5}{s}$         \\
    LTA window                  &       $\SI{100}{s}$       \\
    Trigger level               &       4.4                 \\
    De-trigger level            &       1.5                 \\
    \hline

    Filter                      &       $3-15$ Hz           \\
    Pre-event time              &       $\SI{60}{s}$        \\
    Extract duration            &       $\SI{120}{s}$       \\
    Minimum trigger duration    &       $\SI{5.8}{s}$       \\
    Freeze LTA window           &       no                  \\

    \end{tabular}
\end{table}
1
  • Rather than on the side, I suggest putting the text as a supplementary row after the rule: \multicolumn{2}{c}{text here}. Avoid the vertical rule, that serves no purpose, and all will be well.
    – egreg
    Jul 16, 2014 at 12:44

2 Answers 2

5

Please always post complete documnents showing all packages used (your example required siunitx)

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{table}[htbp]\centering
    \renewcommand{\arraystretch}{1.3}
    \caption[..]{..} \label{tab:trigger}

    \begin{tabular}{l | r}  

    \multicolumn{1}{c|}{\textbf{PARAMETER}}     &   \multicolumn{1}{c}{\textbf{VALUE}}      \\ 
    \hline \hline

    STA window                  &       $\SI{5}{s}$         \\
    LTA window                  &       $\SI{100}{s}$       \\
    Trigger level               &       4.4                 \\
    De-trigger level            &       1.5%       
\smash{\raisebox{-8pt}{\rlap{\quad here!!}}}          \\
    \hline
    Filter                      &       $3-15$ Hz           \\
    Pre-event time              &       $\SI{60}{s}$        \\
    Extract duration            &       $\SI{120}{s}$       \\
    Minimum trigger duration    &       $\SI{5.8}{s}$       \\
    Freeze LTA window           &       no                  \\

    \end{tabular}
\end{table}

\end{document}
1
  • Thank you for this answer. I'll consider your suggestions for the next time. :) Jul 16, 2014 at 12:36
4

I believe that the text should be in a supplementary row below the rule: just remove the vertical rule, which serves no purpose. I added also the analog for the first table chunk.

\documentclass{article}
\usepackage{siunitx,booktabs}
\sisetup{range-phrase=--}

\begin{document}

\begin{tabular}{l r}
\toprule
\multicolumn{1}{c}{\textbf{PARAMETER}} &
\multicolumn{1}{c}{\textbf{VALUE}} \\ 

\midrule
\multicolumn{2}{c}{First part} \\

STA window               & \SI{5}{s}           \\
LTA window               & \SI{100}{s}         \\
Trigger level            & 4.4                 \\
De-trigger level         & 1.5                 \\

\midrule
\multicolumn{2}{c}{Second part} \\

Filter                   & \SIrange{3}{15}{Hz} \\
Pre-event time           & \SI{60}{s}          \\
Extract duration         & \SI{120}{s}         \\
Minimum trigger duration & \SI{5.8}{s}         \\
Freeze LTA window        & no          \\

\bottomrule
\end{tabular}

\end{document}

enter image description here

Note that you don't need $...$ around \SI{...}{...} and that in ranges the unit should be repeated, so the input is not mistaken for “three minus fifteen hertz”.

Compare it to the output of David's answer

enter image description here

2
  • Very nice suggestions,thank you for that. Actually, it matches my desires even more. :) Jul 16, 2014 at 13:28
  • And ants with inky feet have wandered between rows 3 and 4 of part 1 in David's, but left your output alone! Actually, I thought this must be my screen and tried wiping it, but it seems not. Or it is awfully specific. [But your image is dramatically better than anything Okular can manage even ants' help.]
    – cfr
    Apr 5 at 5:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .