在表格中制作粗水平线和粗垂直线

在表格中制作粗水平线和粗垂直线

我有一个表格的代码。线条的默认粗细是多少?我想将垂直线的粗细加倍以区分“总列”,我想将水平线的粗细加倍以区分“总行”。(我想我也应该将标题之间的线加粗。)

\documentclass{amsart}

\begin{document}
\noindent \hspace*{\fill}
\begin{tabular}{|| c | c | c | c ||} \hline
\multicolumn{4}{|| c ||}{{\bf Residents of Preston City}} \\ \hline
        &   Employed    &   Unemployed  &   Total \\ \hline
Men     &   27,000      &               &          \\ \hline
Women   &               &               &   21,500 \\ \hline
Total   &   48,000      &               &   50,500 \\ \hline
\end{tabular}
\hspace{\fill} 

\end{document}

答案1

您可以使用 makecell,它具有\Xhline{thickness}\Xcline{thickness}{col1-col2}命令。

或者,boldline来自shipunovbundle 的包有\hlineB\clineB命令;参数是numtimes \arrayrulewidth。它还有一个V{num}垂直规则说明符,用于替换|

顺便说一下,默认\arrayrulewidth0.4pt

两种解决方案的演示:

\documentclass{amsart}
\usepackage{makecell}
\usepackage{boldline}
\setcellgapes{3pt}

\begin{document}
\noindent \hspace*{\fill}
\begin{center}
  \makegapedcells
  \begin{tabular}{|| c | c | c !{\vrule width0.8pt}c ||}
    \hline
    \multicolumn{4}{|| c ||}{{\bf Residents of Preston City}} \\
    \hline
          & Employed & Unemployed & Total \\
    \hline
    Men & 27,000 & & \\
    \hline
    Women & & & 21,500 \\
    \Xhline{0.8pt}
    Total & 48,000 & & 50,500 \\
    \hline
  \end{tabular}

  \vskip3ex
  \begin{tabular}{|| c | c | c V{2}c ||}
    \hline
    \multicolumn{4}{|| c ||}{{\bf Residents of Preston City}} \\
    \hline
          & Employed & Unemployed & Total \\
    \hline
    Men & 27,000 & & \\
    \hline
    Women & & & 21,500 \\
    \hlineB{2}
    Total & 48,000 & & 50,500 \\
    \hline
  \end{tabular}
\end{center}

\end{document} 

在此处输入图片描述

相关内容