I wanted to write the code for this specific table in Latex (the image just above). I want to define the width of the table borders, the color of the table borders and also the white space between the two cells. I also wanted the text to be horizontally and vertically centered.
I tried something like this :
\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{tabularx, graphicx}
\definecolor{green}{RGB}{0,255,0}
\definecolor{blue}{RGB}{0,0,255}
\begin{document}
\setlength{\arrayrulewidth}{1mm}
\renewcommand{\arraystretch}{2}
\noindent
\begin{table}[h!]
\centering
\begin{tabular}{cc}
\arrayrulecolor{green}
\begin{tabular}{|>{\centering\arraybackslash}m{5cm}|}
\hline
\color{green} GREEN \\
\hline
\end{tabular}
&
\arrayrulecolor{blue}
\begin{tabular}{|>{\centering\arraybackslash}m{5cm}|}
\hline
\color{blue} BLUE \\
\hline
\end{tabular}
\end{tabular}
\end{table}
\end{document}
I edited my code, it works, but I have a warning that I can't suppress : "You have used a \hline command in the wrong place, probably outside a table. If the \hline command is written inside a table, try including \ before it."
It seems that I can't change the border's color inside a table.
\parbox
orminipage
and\fcolorbox
(of thexcolor
package);tikz
; ortcolorbox
etc.