3

I would like to remove the what is inside the red boxes below:

enter image description here

I am using the following code:

\documentclass{article}
\usepackage{tabularray}
\usepackage{xcolor}
\usepackage{lipsum}

\definecolor{mygray}{RGB}{238, 238, 238}
    
\begin{document}
    
\begin{longtblr}[
    caption = {Example of a long table with merged rows},
    label = {tab:example},
    ]{
        width = \textwidth,
        colspec = {|X[1,c,m]|X[1,l,m]|X[1,l,m]|},
        rowhead = 1,
        row{1} = {bg=mygray},
    }
    \hline
    Name & Country & Description \\
    \hline
    Alice & USA & \lipsum[1][1-1] \\
    \cline{2-3}
    & Canada & \lipsum[2][1-1] \\
    \cline{2-3}
    & Mexico & \lipsum[3][1-1] \\
    \hline
    Bob & UK & \lipsum[4][1-2] \\
    \cline{2-3}
    & France & \lipsum[5][1-3] \\
    \cline{2-3}
    & Germany & \lipsum[6][1-4] \\
    \hline
    Charlie & China & \lipsum[7][1-1] \\
    \cline{2-3}
    & Japan & \lipsum[8][1-1] \\
    \cline{2-3}
    & Korea & \lipsum[9][1-1] \\
    \hline
\end{longtblr}

\end{document}

1 Answer 1

3

For global setting of this features put in preamble the following instructions:

\DefTblrTemplate{contfoot-text}{default}{}
\DefTblrTemplate{conthead-text}{default}{}

MWE:

\documentclass{article}
\usepackage{lipsum}
\usepackage[latin]{babel}   % for hyphenation of lipsum text, 
                            % remove in real document

\usepackage{xcolor}
\definecolor{mygray}{RGB}{238, 238, 238}
\usepackage{ragged2e}
\usepackage{tabularray}
\DefTblrTemplate{contfoot-text}{default}{}  % <---
\DefTblrTemplate{conthead-text}{default}{}  % <---

\begin{document}

\begin{longtblr}[
    caption = {Example of a long table with merged rows},
    label = {tab:example},
    ]{hlines, vlines,
        colspec = {X[c,h] X[l] X[cmd={\RaggedRight\hspace{0pt}}]},
        row{1} = {bg=mygray},
        rowhead = 1,
    }
Name    & Country   & Description       \\*
%
\SetCell[r=3]{} Alice   
        & USA       & \lipsum[1][1-1]   \\*
        & Canada    & \lipsum[2][1-1]   \\*
        & Mexico    & \lipsum[3][1-1]   \\

\SetCell[r=3]{} Bob     
        & UK        & \lipsum[4][1-2]   \\*
        & France    & \lipsum[5][1-3]   \\*
        & Germany   & \lipsum[6][1-4]   \\
\SetCell[r=3]{} Charlie 
        & China     & \lipsum[7][1-1]   \\*
        & Japan     & \lipsum[8][1-1]   \\*
        & Korea     & \lipsum[9][1-1]   \\
\end{longtblr}

\end{document}

enter image description here

2
  • Thanks, @Zarko, for your solution and for having improved my code! I would like also to thank you for the detailed edit you did in my previous question: Definitely, it has helped me a lot to understand how to work with tabularray package.
    – PaulS
    Commented Sep 11, 2023 at 10:37
  • 1
    @PaulS, you are welcome!
    – Zarko
    Commented Sep 11, 2023 at 10:56

You must log in to answer this question.

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