does any body know how to this kind of coloured boxes in latex? I have tried, but i failed dramatically
Asked
Active
Viewed 693 times
1 Answers
2
Like this?
MWE:
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{document}
{ \renewcommand\tabularxcolumn[1]{m{#1}}
\setlength\arrayrulewidth{1pt}\arrayrulecolor{white}
\sffamily
\rowcolors{2}{cyan!20}{cyan!10!gray!20}
\begin{tabularx}{\linewidth}{l|C|C|C}
\rowcolor{cyan!50!gray}
\color{white} Event & \color{white} Number of Years Ago
& \color{white} Number of Days Ago on Calendar
& \color{white} Date/Time on calendar \\
\hline
xxx & y & y & Jan. 1, 12 am \\
\hline
xxx xxx xxx xxx xxx xxx xxx xxx & y yy yyy yyyy yyyyy
& y & Jan. 1, 12 am \\
\hline
xxx xxx xxx & & & \\
\hline
xx xxx xxxx xxxxx & & & \\
\end{tabularx}
}
\end{document}
Real content of table and selection desired row colors I left to you :).
Zarko
- 296,517
-
Thank you very much, sorry for not posting what i ad done. I had other way, but they didn't like what i did. I had four separate coloured boxes one next to the other, that i knew how to do it but i could,'t do what you just did thanks. – cristian Apr 05 '17 at 15:37

![[1]: https://i.stack.imgur.com/v224a](../../images/13a5a057ed70cdac66049b9eb8a08813.webp)
\begin{tcbitemize}[raster columns=4,raster equal height, colframe=red!75!black,colback=red!5!white,fonttitle=\bfseries] \tcbitem[squeezed title={Eventos}] \end{tcbitemize} And work is not bad, the ting is wit this i got 4 separate colored boxes as you can see but i was unable to replicate this one that i wanted. – cristian Apr 05 '17 at 14:50