I am trying to add a table like below in Latex. Can anyone please help?
Here is the one I have:
\documentclass{article} \usepackage[table]{xcolor} \begin{document} \renewcommand{\arraystretch}{1.3} {\columncolor{2}{green!80!yellow!50}{green!70!yellow!40} \begin{tabular}{ |p{1cm}|p{1cm} |p{1cm}|p{1cm}| } \hline \multicolumn{2}{|c|}{t = 5} \\ \hline Selection & EC & Selection & EC \\ \hline AF & AF & Selection & EC \\ Ala & ALA & Selection & EC \\ \hline \end{tabular} } \end{document} However, this alters row color instead of column and also I am unable to add other columns.
UPDATE:
I am trying below code as posted by Bernerd:
\begin{tabular}{ || *{2}{>{\columncolor{blue!30!white!50}}p{1.5cm}| >{\columncolor{white}}p{1.5cm}|| }} \hline \rowcolor{white} \multicolumn{2}{||c|}{t = 5} & \multicolumn{2}{||c||}{t = 10} \\ \hline \hline Selection & EC & Selection & EC \\ \hline Afghan & AF & Afghan & AF\\ Aland & ALA & Aland & ALA \\ \hline \end{tabular} However, the column separating lines are not aligned!


\multicolumnandcolortblmight be interesting for you.\columncolorinstead or\rowcolor. To add more columns, add as many column specifiers as neede (for examplelllfor three left aligned columns or|p{3cm}|p{3cm}|p{3cm}|for three columns that are 3 cm wide and are separated by vertical lines.\setlength{\arrayrulewidth}{1mm}\setlength{\tabcolsep}{18pt}\renewcommand{\arraystretch}{2.5}is really a good idea as this will give you extremely wide lines and also quite a lot of empty space aroudn the contents of each cell. If your table will contain 11 columns, you will most likely not fit it onto a page with these settings.