I load xcolor
with option table
, to get alternating row colors
However, I can't remove the color padding before the text of the first column (when using @{}
.
In xcolor documentation, I see options for controlling it with the \columncolor
command, but NOT with the \rowcolors
. Here is the improper table (image below):
\PassOptionsToPackage{dvipsnames,svgnames*,x11names*,table}{xcolor}
\documentclass[12pt,a4paper]{report}
\usepackage{tabularx,longtable} % longtable is used in other places of the full document.
\usepackage{booktabs}
\usepackage{colortbl} % tabularx complains that \columncolor is undefined
\usepackage{xcolor}
\begin{document}
\begin{table}[h]
\rowcolors{1}{}{gray!25}%[0pt]
\footnotesize%
\begin{tabularx}{1.2\linewidth}{@{}p{21mm}*{2}{p{9mm}}p{12mm}p{14mm} *{3}{X} p{9mm} X@{}}
\toprule
{} & Ref & van Muut 2012 & (1)\newline original\newline siteMPL & (2)\newline original\newline branchMPL & (3)\newline cleaned\newline branchMPL & (4)\newline fsa\newline branchMPL & (5)\newline fsa+cleaned\newline branchMPL & (6)\newline fsa\newline Beast & (7)\newline fsa+cleaned\newline Beast \tabularnewline
\midrule
Cebidae & 16,07 & 19,10 & 18,60 & 19,97 & 19,61 & 19,60 & 18,11 & 13,84 & 12,35 \tabularnewline
Platyrrhini & 19,68 & 25,30 & 22,67 & 22,69 & 22,41 & 22,39 & 20,71 & 18,79 & 17,41 \tabularnewline
Pan & 2,82 & 2,70 & 1,41 & 1,37 & 1,29 & 1,31 & 1,17 & 1,55 & 1,31 \tabularnewline
HomoPan & 6,65 & 7,90 & 4,51 & 4,50 & 4,28 & 4,32 & 3,83 & 4,12 & 3,62 \tabularnewline
Homininae & 9,06 & 10,50 & 6,24 & 6,15 & 5,96 & 5,96 & 5,52 & 6,02 & 5,36 \tabularnewline
Hominidae & 15,76 & 20,30 & 13,06 & 13,00 & 12,69 & 12,66 & 11,79 & 11,74 & 10,37 \tabularnewline
Hominoidea & 20,19 & 24,00 & 16,37 & 15,78 & 15,32 & 15,26 & 14,63 & 14,93 & 13,46 \tabularnewline
Catarrhini & 29,44 & 32,60 & 27,60 & 27,27 & 26,69 & 26,71 & 24,71 & 24,47 & 22,67 \tabularnewline
Cercopithecidae & 19,42 & 21,90 & 14,71 & 14,39 & 13,56 & 13,54 & 12,21 & 11,79 & 10,66 \tabularnewline
Cercopithecinae & 13,75 & 16,20 & 10,40 & 10,15 & 9,33 & 9,34 & 8,15 & 7,94 & 7,10 \tabularnewline
Papionini & 12,40 & 13,20 & 6,58 & 6,42 & 5,82 & 5,78 & 4,79 & 5,67 & 5,04 \tabularnewline
Macaca & 5,28 & 8,50 & 2,16 & 2,23 & 2,04 & 2,07 & 1,84 & 2,49 & 2,17 \tabularnewline
\bottomrule
\end{tabularx}
\caption{Median speciation ages by procedure, in My.}\label{tab:median-ages}
\end{table}
\end{document}
I tried :
\rowcolors{1}{}{gray!25}[0pt]
but the command does not take optionsdefining my first column with
@{\columncolor{}[0pt][\tabcolsep]}p{21mm}
, but it keeps complaining:! Undefined control sequence. <template> ...rstrutbox \d@llarbegin \columncolor {}[0pt][\tabcolsep]\relax \d@llar... l.30 \end{tabularx}
@{\setlength{\tabcolsep}{0pt}}p{21mm}
: no effect.Inserting
\fct
before the row throws an "undefined control sequence" as well, although based on this answer, this is exactly what I need.! Undefined control sequence. <recently read> \fct l.30 \end{tabularx}
These answers didn't help:
@{}
at begin column specification, it will work as you expect. However, if you like to have it, than see tex.stackexchange.com/questions/365685/…