I make a table using cals package, I want to modify the width of the table using colwidths , when I rewrite the value in this code:\colwidths{{\dimexpr(\columnwidth)/34*4\relax}, the table widen to the right ,how could I make it widen to the left and right? And if I want to change the rule color to the RGB:221, 216, 195, how could I modify the code? Here is my code
\documentclass[a4paper, 11pt, UTF8]{ctexrep}
\usepackage[T1]{fontenc}
\usepackage{ctex}
\usepackage{etoolbox}
\usepackage{cals, caption}
\usepackage[svgnames]{xcolor}
\definecolor{st_table_blue}{RGB}{87, 142, 210}
\definecolor{gridcolor}{RGB}{221, 216, 195}
\let\nc=\nullcell % Shortcuts
\let\sc=\spancontent
\begin{document}
\begin{table}
\caption{A table\label{tabelTable}}
\begin{calstable}[c]
%\arrayrulecolor{gridcolor}
% Defining columns relative to each other and relative to the margins
\colwidths{{\dimexpr(\columnwidth)/34*4\relax}
{\dimexpr(\columnwidth)/34*12\relax}
{\dimexpr(\columnwidth)/34*6\relax}
{\dimexpr(\columnwidth)/34*6\relax}
%{\dimexpr(\columnwidth)/34*6\relax}
{\dimexpr(\columnwidth)/25*6\relax}
}
% The tabular fills the text area if sum of all columns is 6
% Set up the tabular
\makeatletter
%\def\cals@framers@width{0.2pt}
\def\cals@framers@width{0.2pt} % Outside frame rules, reduce if the rule is too heavy
\def\cals@framecs@width{0.2pt}
\def\cals@framers@color{gridcolor}
\def\cals@bgcolor{}
\def\cals@AtBeginCell{\vfil} % Ensure that all cells is vertically centred
\setlength{\cals@paddingL}{3pt}
\setlength{\cals@paddingR}{3pt}
\def\lblue{\ifx\cals@bgcolor\empty % "Switch" to turn on and off colour
%\def\cals@bgcolor{LightSteelBlue}
\def\cals@bgcolor{st_table_blue}
\else \def\cals@bgcolor{} \fi}
% R1H1
\thead{\footnotesize\bfseries
\brow
\lblue\nc{lrt}
\nc{ltb}
\nc{tb}
\nc{rtb}\alignC\sc{Heading spanning three columns}
\nc{lrt}
\erow
%R2H2
\brow
\nc{lrb}\alignC\sc{Text}
%\cell{\bfseries\textcolor{white}{Subheading is long and that wraps}}
\cell{\bfseries\textcolor{white}{FDA/NMPA\\批准于本癌种}}
\cell{Short}
\cell{Subheading that wraps}
\nc{lrb}\alignC\sc{Text}\lblue
\erow
\mdseries}
\tfoot{\lastrule\strut}
%R3B1
\brow
\alignC\cell{Wrapping text}
%\cell{Horiz. and vertic. centred}
\alignC\cell{阿法替尼*,达克替尼*, 奥西替尼*,吉非替尼*,埃克替尼*,厄洛替尼*,阿美替尼*}
\cell{2}
\cell{3}
\cell{1}
\erow
%R3B1
\brow
\alignC\cell{1}
\cell{2}
\cell{2}
\cell{3}
\cell{1}
\erow
\makeatletter
\end{calstable}
\end{table}
\end{document}
xcolor
package provides the necessary commands to produce tables with alternate row colors, when loaded with the table option. The command\rowcolors{<''starting row''>}{<''odd color''>}{<''even color''>}
has to be specified right before the tabular environment starts.\usepackage{xcolor,colortbl}
then\arrayrulecolor{red}
.