I'd like to create boxes (it may also be two columns) side by side such as in the following image. Also, in order to "highlight" the content, I'd like to add some gray background into it.
-
1Welcome to TeX.SE! Please show us what you tray so far (the best in the form of small but complete document). How you like highlight content? Whole box or just a line of text in it. In the case of the later, you may use table instead of box.– ZarkoApr 9, 2022 at 12:40
-
1@Zarko it would be the whole box, are tables able to accomplish this? I suppose I'd have to format column size, right?– Akari OozoraApr 9, 2022 at 12:48
-
Please (again), show us what you try so far. Sorry, I do not understand your comment.– ZarkoApr 9, 2022 at 14:09
Add a comment
|
1 Answer
To long for the comment ...
Do you like to achieve the first or the second image?
For both I use the following MWE:
\documentclass{article}
\usepackage{xcolor}
\usepackage{tabularray}
\begin{document}
\begin{center}
\begin{tblr}{vline{2} = {2-Z}{solid},
colspec={X[l] X[l, bg=gray!30]},
row{1} = {font=\bfseries, c}
}
\hline
text & \SetCell{bg=white} text \\
\hline
1 & 20 20 \\
10 10 & 15 15 \\
1 & 59 41 \\
\hline
\end{tblr}
\bigskip
\begin{tblr}{vline{2} = {2-Z}{solid},
colspec={X[l] X[l]},
row{1} = {font=\bfseries, c}
}
\hline
text & text \\
\hline
1 & 20 20 \\
10 10 & 15 15 \\
1 & \SetCell{bg=gray!30}
59 41 \\
10 5 & 11 31 153 \\
2 & \\
\hline
\end{tblr}
\end{center}
\end{document}