1

Within the shown MWE, I need to avoid breaking the table in midst of merged rows. However, is there a way to do this automatically without using the approach described in

Break longtable on multirows

Since I will have to manually adjust the location of the command \pagebreak

On each time I modify the document content which may result in modifying table location and thus shifting position of rows

Secondly, the horizontal lines do not extend till the end of the table, is there a fix??

Thirdly, there is interference between the row repeated at the top of each page and the actual content of the first row

\documentclass[a4paper,12pt,twoside]{book}
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,margin=2.5cm,bindingoffset=0.5cm]{geometry} 

\usepackage[bidi=basic,layout=lists.tabular]{babel}
\babelfont[english]{rm}{Times New Roman}

\usepackage[table]{xcolor}
\usepackage{tabu,multirow} 
\usepackage{array} 
\newcolumntype{?}[1]{!{\vrule width #1}} 
\usepackage{booktabs}
\setlength{\belowrulesep}{0pt}
\setlength{\belowbottomsep}{0pt}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\setlength{\abovetopsep}{0pt}
\usepackage{longtable}
\usepackage{makecell} 
\usepackage{boldline} 
\usepackage{hhline}
\usepackage{rotating}

\begin{document}



\begin{longtable}{?{1mm}>{\centering\arraybackslash}m{0.2\textwidth}|c|c|c|c|c?{1mm}} 

\toprule[1mm]

 & \multicolumn{2}{c?{1mm}}{\textbf{U.S. CUSTOMARY UNITS}} & & \multicolumn{2}{c?{1mm}}{\textbf{Equivlent SI Unit}} \\
\cmidrule[1.25pt]{2-3}
\cmidrule[1.25pt]{5-6}
\multirow{-2}{*}{\textbf{Type of quantity}} & \textbf{Unit} & \textbf{Abbreviation} & 
\multirow{-2}{*}{\textbf{Multiplication factor}} & \textbf{Unit} & \textbf{Abbreviation} \\

\Xhline{1.5pt} 
        \endfirsthead

\toprule[1mm]
 & \multicolumn{2}{c?{1mm}}{\textbf{U.S. CUSTOMARY UNITS}} & & \multicolumn{2}{c?{1mm}}{\textbf{Equivlent SI Unit}} \\
\cmidrule[1.25pt]{2-3}
\cmidrule[1.25pt]{5-6}
\multirow{-2}{*}{\textbf{Type of quantity}} & \textbf{Unit} & \textbf{Abbreviation} & 
\multirow{-2}{*}{\textbf{Multiplication factor}} & \textbf{Unit} & \textbf{Abbreviation} \\

\Xhline{1.5pt} 
        \endhead


\multicolumn{6}{c}{Continued}\\   
        \bottomrule
        \endfoot
        \bottomrule[1mm]
        \endlastfoot

\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 


\rowcolor{white}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4}
\rowcolor{white}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4}
\rowcolor{white}
\multirow{-3}{*}{\textbf{Mass}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-3}{*}{m/s} &  \multirow{-3}{*}{m/s} \\
\Xhline{1pt} 


\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 


\rowcolor{white}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4}
\rowcolor{white}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4}
\rowcolor{white}
\multirow{-3}{*}{\textbf{Mass}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-3}{*}{m/s} &  \multirow{-3}{*}{m/s} \\
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 

\rowcolor{white}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4}
\rowcolor{white}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4}
\rowcolor{white}
\multirow{-3}{*}{\textbf{Mass}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-3}{*}{m/s} &  \multirow{-3}{*}{m/s} \\
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 


\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 


\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 

\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 



\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 


\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 


\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 


\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 


\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
 & cu  & cu & slug**=$\frac{Ib.sec^2}{ft}$ & & \\
\cmidrule[0.5pt]{2-4} 
\rowcolor{gray!25}
\multirow{-4}{*}{\textbf{Length}}& meter* & m & slug**=$\frac{Ib.sec^2}{ft}$ & \multirow{-4}{*}{m/s} &  \multirow{-4}{*}{m/s} \\ 
\Xhline{1pt} 


\end{longtable}

\end{document}

enter image description here enter image description here enter image description here

3
  • What about the \\* vs. \\ approach also mentioned in the linked answer?
    – leandriis
    Nov 28, 2019 at 13:30
  • Regarding the horiontal lines: From the attached screenshot, I'd guess that your table is far wider than the page, resulting in the atbel being cut off and the lines being narrower thatn the table. You might want to fix this first.
    – leandriis
    Nov 28, 2019 at 13:31
  • the \\* is not working, however, the multi-row break is more urgent right now
    – Silva
    Nov 28, 2019 at 16:07

2 Answers 2

1

I also manage to find a possible solution using longtable. However, as well known, coloured cells do not work well together with vertical and horizontal rules neither in longtable nor in tabular, so I did not even try. It is unnecessary to ha bot coloured rows and horizontal rules in a table. Since your tabular shall be read from left to right, you can also et rid of the vertical rules if you decide to have colours.

You may try to replace my \hlines with your booktabs rules, to see if you have success. If I were you, I would have typeset the tabular as a traditional booktabs table, without gray, and without vertical rules.

enter image description here enter image description here

\documentclass[a4paper, landscape]{article}
\usepackage{array, longtable}
\usepackage[table]{xcolor}
\usepackage[left=2cm, right=2cm, landscape]{geometry}
\setlength{\extrarowheight}{4pt}
\newcolumntype{D}{wc{\dimexpr(((\linewidth/12)*3)-(2\tabcolsep+2\arrayrulewidth))}}
\newcolumntype{S}{wc{\dimexpr(((\linewidth/12)*2)-(2\tabcolsep+2\arrayrulewidth))}}
\newcolumntype{F}{wc{\dimexpr((\linewidth/12)-(2\tabcolsep+2\arrayrulewidth))}}

\begin{document}
\sffamily

\begin{longtable}{|>{\bfseries}D | F | S | D | F | S |} 
\hline
Type of quantity
&\multicolumn{2}{@{}c@{}|}{\begin{tabular}{F|S}\multicolumn{2}{D}{\bfseries U.S. CUSTOMARY UNITS}\\\hline \bfseries Unit&\bfseries Abbreviation\end{tabular}}
& \bfseries Multiplication factor
&\multicolumn{2}{@{}c@{}|}{\begin{tabular}{F|S}\multicolumn{2}{D}{\bfseries Equivlent SI Unit}\\\hline \bfseries Unit&\bfseries Abbreviation\end{tabular}}
\endhead
\hline

Length
&
\multicolumn{3}{@{}c@{}|}{\begin{tabular}{F|S|D}
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
meter*& m & slug**=$\frac{Ib.sec^2}{ft}$\\
\end{tabular}}
& m/s
& m/s\\
\hline
Mass
&
\multicolumn{3}{@{}c@{}|}{\begin{tabular}{F|S|D}
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
meter*& m & slug**=$\frac{Ib.sec^2}{ft}$\\
\end{tabular}}
& m/s
& m/s \\\hline

Length
&
\multicolumn{3}{@{}c@{}|}{\begin{tabular}{F|S|D}
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
meter*& m & slug**=$\frac{Ib.sec^2}{ft}$\\
\end{tabular}}
& m/s
& m/s\\
\hline
Mass
&
\multicolumn{3}{@{}c@{}|}{\begin{tabular}{F|S|D}
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
meter*& m & slug**=$\frac{Ib.sec^2}{ft}$\\
\end{tabular}}
& m/s
& m/s \\\hline

Length
&
\multicolumn{3}{@{}c@{}|}{\begin{tabular}{F|S|D}
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
meter*& m & slug**=$\frac{Ib.sec^2}{ft}$\\
\end{tabular}}
& m/s
& m/s\\
\hline
Mass
&
\multicolumn{3}{@{}c@{}|}{\begin{tabular}{F|S|D}
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
meter*& m & slug**=$\frac{Ib.sec^2}{ft}$\\
\end{tabular}}
& m/s
& m/s \\\hline

Length
&
\multicolumn{3}{@{}c@{}|}{\begin{tabular}{F|S|D}
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
meter*& m & slug**=$\frac{Ib.sec^2}{ft}$\\
\end{tabular}}
& m/s
& m/s\\
\hline

Length
&
\multicolumn{3}{@{}c@{}|}{\begin{tabular}{F|S|D}
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
meter*& m & slug**=$\frac{Ib.sec^2}{ft}$\\
\end{tabular}}
& m/s
& m/s\\
\hline

Length
&
\multicolumn{3}{@{}c@{}|}{\begin{tabular}{F|S|D}
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
cu& cu & slug**=$\frac{Ib.sec^2}{ft}$\\\hline
meter*& m & slug**=$\frac{Ib.sec^2}{ft}$\\
\end{tabular}}
& m/s
& m/s\\
\hline

\end{longtable}

\end{document}
1

multirow is a layer on top of a number of rows, so each underlying row is a perfect place for longtable to put a page break. This is documented in the manual section 3.6:

It is possible to use \multirow in a longtable environment (as well as in its descendent longtabu). However, care must be taken that the longtable doesn’t break the multirow entry when it is near the bottom of the page.

I have provided another answer where I use nested tables instead of multirow. It was difficult to have the table line up perfectly, due to all your different lines, and coloured rows i nearly impossible, so I did not even try.

In my opinion, the best approach is to leave the table as is, until you have finished your document. You can then manually go through the tables a correct any table page break errors together with other layout issues, which will save your time.

However, if yo insist using rules and colours together and have an automatic solution, such table is pretty easy to set up using the package cals. I have typeset your table, more or less similar to your MWE. Be aware that cals has not the advanced footer command that you find in longtable (and xltabular). Using spanned cells, colours and stil get visible rules and correct cell alignment, is easy.

I set the table in landscape mode, since it is so wide. It is possible to cram it into a portrait mode with narrow margins, but then you need a smaller font size.

enter image description here enter image description here enter image description here

\documentclass[landscape, headinclude=true, footinclude=true, DIV=15]{scrartcl}
\usepackage{cals}
\usepackage[table]{xcolor}

\let\nc=\nullcell          % Shortcuts
\let\sc=\spancontent

\begin{document}

\begin{calstable}

% Defining 6 columns relative to each other and relative to the margins
\colwidths{{\dimexpr(\columnwidth/12)*3\relax}
            {\dimexpr(\columnwidth/12)\relax}
            {\dimexpr(\columnwidth/12)*2\relax}
            {\dimexpr(\columnwidth/12)*3\relax}
            {\dimexpr(\columnwidth/12)\relax}
            {\dimexpr(\columnwidth/12)*2\relax}
            }
% The tabular fills the text area

% Set up the tabular
\makeatletter
\def\cals@framers@width{1pt}   % Outside frame rules, reduce if the rule is too heavy
\def\cals@framecs@width{1pt}
\def\cals@bodyrs@width{1pt}    % Rule between heading and body
\cals@setpadding{Ag}
\cals@setcellprevdepth{Al}
\def\cals@cs@width{0.4pt}      % Inside rules, reduce if the rule is too heavy
\def\cals@rs@width{0.4pt}
\def\cals@bgcolor{}            % Define cals@bgcolor to empty

\def\gray{\ifx\cals@bgcolor\empty   % Colour switch (on-off)
    \def\cals@bgcolor{lightgray!30}
\else \def\cals@bgcolor{} \fi}

\setlength{\cals@paddingT}{2.5pt}   % Reducing the top cell padding a little bit
\setlength{\cals@paddingB}{2.5pt}   % Reducing the bottom cell padding a little bit

\makeatother

\thead{\bfseries\selectfont
\brow 
     \alignC\nc{lrt}
     \nc{ltb}
     \nc{rtb}\sc{U.S. CUSTOMARY UNITS}
     \alignC\nc{lrt}
     \nc{ltb}
     \nc{rtb}\sc{Equivlent SI Unit}
\erow
\brow 
     \nc{lrb}\sc{\vfil Type of quantity}
     \cell{Unit}
     \cell{Abbreviation}
     \nc{lrb}\sc{\vfil Multiplication factor}
     \cell{Unit}
     \cell{Abbreviation}
\erow
\mdseries\selectfont}
\tfoot{\lastrule\nointerlineskip
\textit{\strut Continues ...}\par}

% R1
\brow
    \gray\nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}\gray
\erow
% R2 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R3 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R4 Body
\brow
    \gray\nc{blr}\sc{\vfil\bfseries Length}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}\gray
\erow
% R5 Body
\brow
    \nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}
\erow
% R6 Body
\brow
    \nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}
\erow
% R7 Body
\brow
    \nc{blr}\sc{\vfil\bfseries Mass}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}
\erow
% R8
\brow
    \gray\nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}\gray
\erow
% R9 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R10 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R11 Body
\brow
    \gray\nc{blr}\sc{\vfil\bfseries Length}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}\gray
\erow
% R12 Body
\brow
    \nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}
\erow
% R13 Body
\brow
    \nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}
\erow
% R14 Body
\brow
    \nc{blr}\sc{\vfil\bfseries Mass}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}
\erow
% R15
\brow
    \gray\nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}\gray
\erow
% R16 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R17 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R18 Body
\brow
    \gray\nc{blr}\sc{\vfil\bfseries Length}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}\gray
\erow
% R19 Body
\brow
    \nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}
\erow
% R20 Body
\brow
    \nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}
\erow
% R21 Body
\brow
    \nc{blr}\sc{\vfil\bfseries Mass}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}
\erow
% R22
\brow
    \gray\nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}\gray
\erow
% R23 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R24 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R25 Body
\brow
    \gray\nc{blr}\sc{\vfil\bfseries Length}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}\gray
\erow
% R26 Body
\brow
    \nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}
\erow
% R27 Body
\brow
    \nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}
\erow
% R28 Body
\brow
    \nc{blr}\sc{\vfil\bfseries Mass}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}
\erow
% R29
\brow
    \gray\nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}\gray
\erow
% R30 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R31 Body
\brow
    \gray\nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}\gray
\erow
% R32 Body
\brow
    \gray\nc{blr}\sc{\vfil\bfseries Length}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}\gray
\erow
% R33 Body
\brow
    \nc{tlr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{tlr}
    \nc{tlr}
\erow
% R34 Body
\brow
    \nc{lr}
    \cell{\vfil cu}
    \cell{\vfil cu}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{lr}
    \nc{lr}
\erow
% R35 Body
\brow
    \nc{blr}\sc{\vfil\bfseries Mass}
    \cell{\vfil meter*}
    \cell{\vfil m}
    \cell{\vfil slug**=$\frac{Ib.sec^2}{ft}$}
    \nc{blr}\sc{\vfil m/s}
    \nc{blr}\sc{\vfil m/s}
\erow
\end{calstable}\par

\end{document}

You must log in to answer this question.

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