I'm trying to color the title line of the table by using the following code:
\documentclass[a4paper, 10pt]{article}
%% Packages %%
\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{fancyhdr}
\usepackage{tikz,float}
\usetikzlibrary{shapes,arrows}
\usepackage{verbatim}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{tabu}
\usepackage{sidecap}
\usepackage{multirow}
\usepackage[sorting=none]{biblatex}
\usepackage{subcaption}
\usepackage{setspace}
\usepackage{multicol}
\usepackage{scalerel}
\usepackage{enumitem}
\usepackage{empheq}
\usepackage{caption}
\usepackage{float}
\usepackage{kantlipsum}
\usepackage{xcolor,colortbl}
\usepackage{mathtools}
\usepackage{listings}
\usepackage[document]{ragged2e}
\setcounter{MaxMatrixCols}{20}
\definecolor{mygreen}{RGB}{28,172,0} % color values Red, Green, Blue
\definecolor{mylilas}{RGB}{170,55,241}
%% Title Page %%
\addbibresource{refbib.bib}
\begin{document}
\begin{table}[htbp]
\begin{center}
{\tabulinesep=1.2mm
\begin{tabu} to 0.9\linewidth { |[2pt] *{3}{X[1 c]|}[2pt] } \tabucline[2pt]{-}
\multicolumn{3}{ |[2pt]c|[2pt] }{\cellcolor{green!20}Initial Conditions} \\ \tabucline[2pt]{-}
$[x(0), y(0), z(0)]_{\text{R}}$ & [-29136.9, 0, 0] & m \\ \hline
$[x(0), y(0), z(0)]_{\text{T}}$ & [0, 0, 0] & m \\ \hline
$[V_{x}(0), V_{y}(0), V_{z}(0)]_{\text{R}}$ & [680.7, 0, 680.7] & m/s \\ \hline
$[V_{x}(0), V_{y}(0), V_{z}(0)]_{\text{Wind}}$ & [0, -10, 0] & m/s \\ \hline
$[V_{x}(0), V_{y}(0), V_{z}(0)]_{\text{Wind Error}}$ & [0, 0, 0] & m/s \\ \hline
Launch Angle & 45 & Deg \\ \tabucline[2pt]{-}
\end{tabu}}
\end{center}
\caption{Initial conditions for test 1}
\end{table}
\end{document}
However, for some reason I still get this result:
Is there a reason that it doesn't show the line in green?
Thank you
\documentclass
to\begin{document}
?Green
color comes for the first row...tabu
package can be problematic, It is not maintained and contain bugs. Also not work well with[table]{xcolor}
etc. I suggest you usetabularx
instead of it.