如何使用超表格线和水平线来去除每个表格单元格的粗线?

如何使用超表格线和水平线来去除每个表格单元格的粗线?

我定义了一个非常大的超级表格。每个表格行都由一条水平线 (\hline) 分隔。表格的标题应该用两条线分隔。在第一页上,一切都很好,正如我想要的那样。

我的问题是,在第二页,即出现 supertabular 的地方,标题中双行的第二行是粗体,这是由表格单元格的 hline 引起的。有没有办法折叠这条线?

这是一个最小的例子。

\documentclass[a4paper,headsepline,12pt]{scrreprt}

\usepackage{supertabular}

\begin{document}
\begin{center}
\tablefirsthead{\hline
\textsc{C1} &
\textsc{C2} &
\textsc{C3} \\\hline\hline}
\tablehead{\hline
\textsc{C1} &
\textsc{C2} &
\textsc{C3} \\\hline\hline}
\tabletail{
\hline
\multicolumn{3}{|r|}{\small continues on next page}
\tablelasttail{\hline\hline}
\\
}
\bottomcaption{{very long tabular}}
\begin{supertabular}{|p{4cm}|p{7.8cm}|p{3.1cm}|}
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
A &
This text is a bit longer to get a two lined table cell &
cat\\\hline
\end{supertabular}
%\caption{Kategorisierung von XÖV-Stereotypen und Kurzbeschreibung der Semantik der Modellelemente auf Basis von \cite[S. 27 - 55]{KoordinierungsstellefurITStandards(KoSIT).2012}}
%\label{table_xoev_stereotypes}

\end{center}
\end{document}

答案1

我支持@Mico,并建议你看看booktabs手动的;如果您想要更知名的来源,您还可以参考《芝加哥格式手册》,它也有类似的建议。

如果您不介意丢失垂直规则(两个来源都强烈推荐),这里有一个使用的解决方案booktabs。我认为应该有一个更简单的解决方案,只\hline在标题中放置一个,在表格主体中放置另一个,但目前我无法弄清楚。

尽管 CMS 没有不鼓励双重规则,您可能需要考虑分别用booktab's更重的\toprule和来替换它们\bottomrule

编辑supertabular+booktabs解决方案存在我最初没有注意到的缺陷:它超出了分页标记,并且由于某种原因没有从第一页开始。如果没有特别的理由使用supertabularlongtable可能是更好的选择。

\documentclass[a4paper,headsepline,12pt]{scrreprt}

\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{longtable}

\begin{document}

%print a table row
\newcommand{\row}{%
    A%
        & This text is a bit longer to get a two lined table cell%
        & cat\\\midrule}

\begin{longtable}{p{4cm}p{7.8cm}p{3.1cm}}
        \caption{A Table}\\
        \midrule
        \textsc{C1} &
        \textsc{C2} &
        \textsc{C3} \\\midrule\midrule
    \endfirsthead
        \caption{A Table (continued)}\\
        \midrule
        \textsc{C1} &
        \textsc{C2} &
        \textsc{C3} \\\midrule\midrule
    \endhead        
        \midrule
        \multicolumn{3}{r}{\small continues on next page}
    \endfoot  
        \addlinespace[-\defaultaddspace]\midrule %don't even need any \addlinespace if the \midrule is added after the table body instead of as \endlastfoot.
    \endlastfoot
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    \row{}
    A%
        & This text is a bit longer to get a two lined table cell%
        & cat\\\midrule
\end{longtable}

\end{document}

相关内容