
關於這例如,現在有:
\documentclass[10pt]{article}
\begin{document}
\arrayrulewidth=0.7pt
\begin{tabular}{|c|c|l|c|c|c|l|}
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
\end{tabular}
\end{document}
這個指令\arrayrulewidth=0.7pt
控制垂直線和水平線的粗細,但現在我想減少內部線(垂直和水平)的粗細,並保持外部線的粗細。
我想為桌子添加顏色,但我做不到。我使用\arrayrulecolor{[color here]}
但僅對內部線條進行了著色,並且我想對整個表格進行著色。
答案1
自從你要求的,這裡有一個表格分割版本的解決方案,即 2 個表格而不是 1 個表格tabular
。efbox
允許我們指定規則顏色、線寬和邊距。為了使框緊密貼合,消除規則和表格之間的任何間隙,我們將邊距設為零。然後將線寬設為0.7pt
,並且\arrayrulewidth
可以保留為預設值或根據需要進行變更。我們需要做的就是設定框規則的顏色和\arrayrulecolor
我們想要的顏色。在這裡,我使用藍色陰影。
\documentclass[10pt]{article}
\usepackage[table]{xcolor}
\usepackage{efbox}
\efboxsetup{linecolor=blue!75!black, linewidth=.7pt, margin=0pt}
\begin{document}
\arrayrulecolor{blue!75!black}
\efbox{\begin{tabular}{c|c|l}
& & \\
& & \\
& & \\
\hline
& & \\
& & \\
& & \\
\hline
& & \\
& & \\
& & \\
\hline
& & \\
& & \\
& & \\
\end{tabular}}
\efbox{\begin{tabular}{c|c|l}
& & \\
& & \\
& & \\
\hline
& & \\
& & \\
& & \\
\hline
& & \\
& & \\
& & \\
\hline
& & \\
& & \\
& & \\
\end{tabular}}
\end{document}
答案2
您可以使用該boldline
套件:這是一個 1pt 粗線的範例:
\documentclass[10pt]{article}
\usepackage{boldline}
\begin{document}
\begin{tabular}{V{2.5}c|c|lV{2.5}cV{2.5}c|c|lV{2.5}}
\clineB{1-3}{2.5}\clineB{5-7}{2.5}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\[-1pt]
\clineB{1-3}{2.5}\clineB{5-7}{2.5}
\end{tabular}
\end{document}
對於彩色線條,它不起作用。我只能提出一個解決方法hhline
,對雙線和線之間的空間進行著色:
\documentclass[10pt]{article}
\usepackage{array, colortbl, xcolor, hhline}
\begin{document}
\setlength\doublerulesep{0.2pt}\arrayrulecolor{red}\doublerulesepcolor{red}
\begin{tabular}{!{\color{red}\vrule width1pt}c|c|l!{\color{red}\vrule width1pt}c!{\color{red}\vrule width1pt}c|c|l!{\color{red}\vrule width1pt}}
\hhline{|===|>{\arrayrulecolor{white}\doublerulesepcolor{white}}~>{\arrayrulecolor{red}\doublerulesepcolor{red}}|:===|}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\cline{1-3}\cline{5-7}
& & & & & & \\
& & & & & & \\
& & & & & & \\
\hhline{===>{\arrayrulecolor{white}\doublerulesepcolor{white}}~%
>{\arrayrulecolor{red}\doublerulesepcolor{red}}|:===}
\end{tabular}
\end{document}