2

I am creating a table using the tabular environment. The first column of the data section begins with the \multirow command. I would like to remove the border on the left side of the first column, and remove the thicker vertical line on the right of the first column over rows 2-6. I have looked at this answer, but I could not figure out how to translate the solution to the multirow context. I have also consulted a multirow help file but came up empty. I do not want to use the booktabs package because the journal where I will submit the article does not want authors to use extra packages. Here is the code for the table.

\begin{table}[h!]
\caption{Statistics for the 1Hz bedload flux time series}\vspace{1ex}
\centering
\scalebox{0.75}{
    \begin{tabular}{c c c c c c}
        & & \multicolumn{2}{c}{\large{\textbf{Steady-state}}} & \multicolumn{2}{c}{\large{\textbf{Transient}}} \\
        \cline{3-6}
        & & t1910min & t4070min & t2150min & t4310min \\
        \hline 
        \multicolumn{2}{c}{Total Time Series Duration (seconds)} & 14,396 & 14,245 & 4,582 & 4,529 \\
        \hline
        \multirow{7}{*}{Total Particle Count} &
        \multicolumn{1}{ |c| }{4 mm} & 21,631 & 28,803 & 80,049 & 97,680 \\ 
        \multicolumn{1}{ |c|  }{}                     &
        \multicolumn{1}{ |c| }{5.6 mm} & 11,423 & 18,043 & 38,782 & 47,241 \\ 
        \multicolumn{1}{ |c|  }{}                        &
        \multicolumn{1}{ |c| }{8 mm} & 5,262 & 9,370 & 17,662 & 21,673  \\ 
        \multicolumn{1}{ |c|  }{}                        &
        \multicolumn{1}{ |c| }{11.3 mm} & 3,303 & 5,710 & 9,630 & 11,626  \\ 
        \multicolumn{1}{ |c|  }{}                        &
        \multicolumn{1}{ |c| }{16 mm} & 935 & 1,719 & 2,695 & 3,087  \\ 
        \multicolumn{1}{ |c|  }{}                        &
        \multicolumn{1}{ |c| }{22.6 mm} & 92 & 278 & 410 & 568 \\
        \multicolumn{1}{ |c|  }{}                        &
        \multicolumn{1}{ c| }{\textbf{Total}} & \textbf{42,646} & \textbf{63,923} & \textbf{149,228} & \textbf{181,875} \\   
        \hline
        \label{Table1}
    \end{tabular}
    }
    \end{table}

Here is the output of the minimal working example, using the \multirow package:

Output of minimal working example

Thanks for your help in advance.

3
  • just delete all the \multicolumn{1}{ |c| }{ you don't want a multicolumn and the left | is making the left border in the first column and the double thickness in the second column. Just use c|c|cccc as the array preamble. May 10, 2019 at 23:31
  • please make your MWE a compete document loading all used packages so people can test it. Also never apply \scalebox to tables (if you do don't forget the % in \scalebox{0.75}{% but far better not to do it May 10, 2019 at 23:32
  • Thanks @David, and I will follow your instructions about the MWE and \scalebox in the future. I tried your suggestion and it did not quite work, but I may have implemented it incorrectly. But, your suggestions led to an output that is close to what I was after. I deleted the` \multicolumn` calls in each line that lists out data, but left these intervening \multicolumn calls: \multicolumn{1}{ |c| }{} . Removing the vertical lines from |c| removed all the vertical lines within the table. I left the array in the preamble as it was because changing it added vertical lines in weird ways.
    – SurfProc
    May 10, 2019 at 23:45

2 Answers 2

2

this answer not solve directly your problem, it rather avoid it with removing all vertical lines in table:

enter image description here

(red lines indicate text border)

since you not provide any information about your document, in mwe (minimal working example) is considered standard article document class. in preamble are loaded packages and defined commands, which enable to design showed table.

\documentclass{article}
\usepackage{booktabs, makecell, multirow, tabularx}
\renewcommand\theadgape{}
\usepackage{siunitx}
\usepackage{etoolbox}% <-- new
\newcommand{\B}{\bfseries}
\robustify\B

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{table}[htb]
    \renewcommand\theadfont{\large\bfseries}
    \sisetup{detect-weight,
             mode=text,
             table-format=3.3,
             output-decimal-marker={,}}
\caption{Statistics for the 1Hz bedload flux time series}\vspace{1ex}
\label{Table1}
    \centering
\begin{tabularx}{\linewidth}{@{} X r SSSS @{}}
    &   & \multicolumn{2}{c}{\thead{Steady-state}}
            & \multicolumn{2}{c}{\thead{Transient}} \\
    \cmidrule(r){3-4}
    \cmidrule(l){5-6}
    &   & {t1910min} & {t4070min} & {t2150min} & {t4310min} \\
    \midrule
\multicolumn{2}{r}{TTSD (seconds):}
                    & 14,396 & 14,245 & 4,582 & 4,529 \\
    \midrule
\multirow{7}{=}{Total Particle Count}
    & \SI{4.0{mm}   &  21,631 &  28,803 &  80,049 &  97,680    \\
    & \SI{5.6}{mm}  &  11,423 &  18,043 &  38,782 &  47,241    \\
    & \SI{8.0}{mm}  &   5,262 &   9,370 &  17,662 &  21,673    \\
    & \SI{11.3}{mm} &   3,303 &   5,710 &   9,630 &  11,626    \\
    & \SI{16.0}{mm} & 935     &   1,719 &   2,695 &   3,087    \\
    & \SI{22.6}{mm} &  92     & 278     & 410     & 568        \\
    & \textbf{Total}
                    &\B 42,646 &\B 63,923 &\B 149,228 &\B 181,875 \\
    \bottomrule
\multicolumn{6}{l}{TTSD: Total Time Series Duration }
    \end{tabularx}
    \end{table}
    \end{document}
3
  • Thanks @Zarko. I implemented the guts of your suggestion, but without the extra packages due to journal restrictions. Only using \multirow I can get a final output that is pretty close to yours. I also like your suggested us of the abbreviation TTSD.
    – SurfProc
    May 11, 2019 at 0:31
  • @SurfProc, what journal it is, that not allow to use standard LaTeX packages? however. it is possible to write table with use multirow package only. just replace S columns with c or r, rules with \hlines, etc (as you probably did).
    – Zarko
    May 11, 2019 at 0:40
  • it is an EGU journal. They supply a .cls file with packages preloaded so copy editing and post production goes more smoothly - atleast that is the story. Yes, you are correct - I can post the MWE to document if that is a standard thing to do?
    – SurfProc
    May 11, 2019 at 0:43
0

I am providing the following answer to follow-up on the excellent suggestions by @David and @Zarko. Here is a minimal working example (MWE) that addresses my questions, but slightly modifies the vertical lines within the table:

\documentclass[11pt]{article}
\usepackage{multirow}
\begin{document}
\begin{table}[h!]
\caption{Statistics for the 1Hz bedload flux time series}\vspace{1ex}
\centering
    \begin{tabular}{cccccc}
        & & \multicolumn{2}{c}{\large{\textbf{Steady-state}}} & \multicolumn{2}{c}{\large{\textbf{Transient}}} \\
        \cline{3-6}
        & & t1910min & t4070min & t2150min & t4310min \\
        \hline 
        \multicolumn{2}{r}{TTSD (sec.)} & 14,396 & 14,245 & 4,582 & 4,529 \\
        \hline
        \multicolumn{1}{ r| }{\multirow{7}{*}{Total Particle Count}}        &
        4 mm & 21,631 & 28,803 & 80,049 & 97,680 \\ 
        \multicolumn{1}{ r| }{}                     &
        5.6 m & 11,423 & 18,043 & 38,782 & 47,241 \\ 
        \multicolumn{1}{ r| }{}                        &
        8 mm & 5,262 & 9,370 & 17,662 & 21,673  \\ 
        \multicolumn{1}{ r| }{}                        &
        11.3 mm & 3,303 & 5,710 & 9,630 & 11,626  \\ 
        \multicolumn{1}{ r| }{}                        &
        16 mm & 935 & 1,719 & 2,695 & 3,087  \\ 
        \multicolumn{1}{ r| }{}                        &
        22.6 mm & 92 & 278 & 410 & 568 \\ \cline{2-6}
        \multicolumn{1}{ r| }{}                        &
        \textbf{Total} & \textbf{42,646} & \textbf{63,923} & \textbf{149,228} & \textbf{181,875} \\ 
        \hline
        \multicolumn{6}{l}{TTSD: Total Time Series Duration }
        \label{Table1}
    \end{tabular}
\end{table}
\end{document}

The MWE provides the resulting table:

MWE Table

I think the Table by @Zarko looks nicer, but my MWE preserves the vertical line between the \multirow text and the data classes. However, I lost the vertical line between the data classes and the data matrix. I appreciate the help.

2
  • hm, this is new question :-). it will be better to ask it a such. On this way your problem will become visible to other site members too. than they will have a chance to help you. temporary i'm busy with some other work ...
    – Zarko
    May 11, 2019 at 19:02
  • Okay, I see your point. My intention was to follow-up on the thread of our discussion around only using \multirow in the tabular environment vs. using the additional packages within your answer. I am pushing ahead with the table from my MWE and consider the help I got to have resolved my main issues. Thanks @Zarko
    – SurfProc
    May 11, 2019 at 19:11

You must log in to answer this question.

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