[Tex/LaTex] tabular: thicker lines

tables

\begin{tabular}{|c|c|c|c|c|c|}
\hline
\multicolumn{2}{|c|}{Foo} & \multicolumn{4}{|c|}{Bar} \\ \hline
\multicolumn{2}{|c}{} & \multicolumn{2}{|c|}{BarA} & \multicolumn{2}{|c|}{BarB} \\ \hline
\multicolumn{2}{|c|}{} & $\lambda$ & $\theta$ & $\lambda$ & $\theta$ \\ \hline
\multirow{2}{*}{FooA} & $\mu$ & 2 & 3 & 8 & 9\\ \cline{2-6}
& $\pi$ & 5 & 6 & 7 & 9 \\ \hline
\multirow{2}{*}{FooB} & $\mu$ & 2 & 3 & 8 & 9 \\ \cline{2-6}
& $\pi$ & 5 & 6 & 7&10 \\
\hline
\end{tabular}

hi, how could I draw a thicker horizontal line between the lines of FooA and those of FooB and also a thicker vertical line between BarA and BarB?

I've tried many solutions found on the Web, but all of them cause some alignment error.

edit:
To clarify in the real table that I'm building I have many Foo columns (FooA, FooB, FooC,…) and many Bar rows (BarA, BarB, BarC,…). If the lines are all equals it's hard to tell to which Foo column and to which Bar row a number belongs. So I want to make thick lines to separate the Foo columns and the Bar rows.

Best Answer

In LaTeX you can do it with tabu. For the thickened \cline (which is now \tabucline[1pt]{2-6}) to not create a gap in the outer frame, one has to “undo” the vertical space added by the rule by annotating the preceding linebreak \\[-1pt].

\documentclass{article}
\usepackage{tabu,multirow}
\begin{document}

\begin{tabu}{|c|c|c|c|[1pt]c|c|}
  \hline
  \multicolumn{2}{|c|}{Foo} & \multicolumn{4}{c|}{Bar} \\ \hline
  \multicolumn{2}{|c|}{} & \multicolumn{2}{c|[1pt]}{BarA} & \multicolumn{2}{c|}{BarB} \\ \hline
  \multicolumn{2}{|c|}{} & $\lambda$ & $\theta$ & $\lambda$ & $\theta$ \\ \hline
  \multirow{2}{*}{FooA} & $\mu$ & 2 & 3 & 8 & 9\\[-1pt] \tabucline[1pt]{2-6}
  & $\pi$ & 5 & 6 & 7 & 9 \\ \hline
  \multirow{2}{*}{FooB} & $\mu$ & 2 & 3 & 8 & 9 \\[-1pt] \tabucline[1pt]{2-6}
  & $\pi$ & 5 & 6 & 7&10 \\
  \hline
\end{tabu}

\end{document}

enter image description here


If you don't want to use tabu (what I totally understand), then the boldline package might be for you. It introduces the following rules

  • V{<factor>} vertical rule which is <factor> thicker than the normal vertical rule.
  • \hlineB{<factor>} horizontal rule which is <factor> thicker than the normal horizontal rule.
  • \clineB{<spec>}{<factor>} horizontal rule which spans the columns given in <spec> and which is <factor> thicker than the normal horizontal rule.

To obtain a rule of 1pt one has to replace two | by V{2.5} and the two \cline by \clineB{2-6}{2.5}.

\documentclass{article}
\usepackage{boldline,multirow}
\begin{document}

\begin{tabular}{|c|c|c|cV{2.5}c|c|}
  \hline
  \multicolumn{2}{|c|}{Foo} & \multicolumn{4}{c|}{Bar} \\ \hline
  \multicolumn{2}{|c|}{} & \multicolumn{2}{cV{2.5}}{BarA} & \multicolumn{2}{c|}{BarB} \\ \hline
  \multicolumn{2}{|c|}{} & $\lambda$ & $\theta$ & $\lambda$ & $\theta$ \\ \hline
  \multirow{2}{*}{FooA} & $\mu$ & 2 & 3 & 8 & 9\\ \clineB{2-6}{2.5}
  & $\pi$ & 5 & 6 & 7 & 9 \\ \hline
  \multirow{2}{*}{FooB} & $\mu$ & 2 & 3 & 8 & 9 \\ \clineB{2-6}{2.5}
  & $\pi$ & 5 & 6 & 7&10 \\
  \hline
\end{tabular}

\end{document}

enter image description here

Related Question