无分页的 Longtable 多行问题

无分页的 Longtable 多行问题

在显示的 MWE 中,我需要避免在合并行中间破坏表格。但是,有没有办法自动执行此操作而不使用中描述的方法

在多行上打破长表

由于我必须手动调整命令的位置 \pagebreak

每次我修改文档内容时,都可能导致修改表格位置,从而改变行的位置

其次,水平线没有延伸到表格末尾,有办法吗?

第三,每页顶部重复的行与第一行的实际内容之间存在干扰

\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}

在此处输入图片描述 在此处输入图片描述 在此处输入图片描述

答案1

我还设法找到了一个可能的解决方案长桌。然而,众所周知,彩色单元格与垂直和水平规则配合使用效果不佳,无论是在长桌表格中也没有,所以我甚至没有尝试。表格中没有必要有彩色行和水平线。由于您的表格应从左到右阅读,因此如果您决定使用颜色,您也可以去掉垂直线。

你可以尝试\hline用你的替换我的书签规则,看看你是否成功了。如果我是你,我会把表格排版成传统的书签表格,无灰度,无垂直线。

在此处输入图片描述 在此处输入图片描述

\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}

答案2

多行是位于多行之上的一层,因此每一行都非常适合放置长桌放置分页符。手册第 3.6 节对此进行了记录:

可以在 longtable 环境中使用 \multirow(以及其派生的 longtabu)。但是,必须注意当多行条目位于页面底部附近时,longtable 不会破坏多行条目。

我提供了另一个答案,我使用嵌套表而不是多行。由于表格中线条和行数各不相同,所以很难让表格完美地排列,这几乎是不可能的,所以我根本没去尝试。

我认为,最好的方法是保留表格原样,直到完成文档。然后,您可以手动检查表格,纠正任何表格分页符错误以及其他布局问题,这将节省您的时间。

但是,如果你坚持使用规则和颜色,并且有一个自动解决方案,那么使用包设置这样的表格相当容易卡路里。我已经排版了你的表格,与你的 MWE 大致相似。请注意卡路里没有您在长桌(和板状的)。使用跨越单元格、颜色以及仍然获得可见规则和正确的单元格对齐,很容易。

由于表格太宽,我将其设置为横向模式。可以将其塞入具有窄边距的纵向模式,但这样你就需要较小的字体大小。

在此处输入图片描述 在此处输入图片描述 在此处输入图片描述

\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}

相关内容