Adding arrayrulecolor command removes top rule
There seems to be problems with coloured \clines in beamer. Here is a workaround, using \cmidrule
from booktabs. I had to neutralise the vertical padding below the rule. I simplified a bit the code: instead of loading colortbl
, I added the table
option to beamer, which passses it to xcolor
, which loads colortbl
.
\documentclass[table]{beamer}
\usetheme{Montpellier}
\usecolortheme[named=gray]{structure}
\usepackage{array, booktabs}
\newcommand{\gr}[1]{\textcolor{gray}{#1}}
\begin{document}
\definecolor{light-gray}{gray}{0.92}
\frame{\arrayrulecolor{light-gray}
\renewcommand{\arraystretch}{1.2}
\begin{tabular}{|>{\raggedright}m{2.45cm}|>{\raggedright\arraybackslash}m{3.4cm}
|>{\raggedright\arraybackslash}m{3.63cm}|}
\cmidrule{2-3}\noalign{\vskip -\belowrulesep}
\multicolumn{1}{c|}{} & \multicolumn{1}{c|}{\gr{short}} & \multicolumn{1}{c|}{\gr{short}}\\\hline
\gr{short text} & very, very long text here & very, very long text here\\\hline
\end{tabular}
}
\end{document}
You can obtain what you want directly with {NiceTabular}
of nicematrix
. A key hvlines-except-corners
draws all the expected rules.
\documentclass{beamer}
\usetheme{Montpellier}
\usecolortheme[named=gray]{structure}
\usepackage{nicematrix}
\newcommand{\gr}[1]{\textcolor{gray}{#1}}
\begin{document}
\begin{frame}
\renewcommand{\arraystretch}{1.2}
\begin{NiceTabular}{wl{2.45cm}>{\raggedright}m{3.4cm}>{\raggedright\arraybackslash}m{3.63cm}}%
[
rules / color = gray!20 ,
hvlines-except-corners
]
& \multicolumn{1}{c}{\gr{short}} & \multicolumn{1}{c}{\gr{short}}\\
\gr{short text} & very, very long text here & very, very long text here\\
\end{NiceTabular}
\end{frame}
\end{document}