1

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.

example

3
  • 1
    Welcome 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.
    – Zarko
    Apr 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? Apr 9, 2022 at 12:48
  • Please (again), show us what you try so far. Sorry, I do not understand your comment.
    – Zarko
    Apr 9, 2022 at 14:09

1 Answer 1

0

To long for the comment ...

Do you like to achieve the first or the second image?

enter image description here

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .