Text overflow in tabularx

tablestabularx

I recently joined this wonderful world and I am trying to solve this problem. I have created a table with tabularx, but the text inside it overflows below. How can I solve this problem? I searched for a similar post but I couldn't find any working solution. Is it possible to resize the height of each (multi)row to fit the text in, while still keeping the text vertically centered? Thanks in advance.

The problem

\documentclass{report}
\usepackage[utf8]{inputenc}

\usepackage{multirow}
\usepackage{array}
\usepackage{ltablex}

\renewcommand\tabularxcolumn[1]{m{#1}}

\begin{document}

\begin{tabularx}{\textwidth} { 
    | >{\raggedright\footnotesize\arraybackslash}X 
    | >{\raggedright\footnotesize\arraybackslash}X 
    | >{\raggedright\footnotesize\arraybackslash}X 
    | >{\raggedright\footnotesize\arraybackslash}X 
    | >{\raggedright\footnotesize\arraybackslash}X 
    | >{\raggedright\footnotesize\arraybackslash}X 
    | >{\raggedright\footnotesize\arraybackslash}X 
    |}
    \hline
    \textbf{Associazione} &
    \textbf{Descrizione} &
    \textbf{Entità coinvolte} &
    \textbf{Cardinalità Min/Max} &
    \textbf{Molteplicità} &
    \textbf{Attributi/ tipo} &
    \textbf{Descrizione attributi} \\ \hline
    \endhead
    \multirow{2}{\linewidth}{Apertura} &
    \multirow{2}{\linewidth}{Rappresenta quali Ticket il Cliente ha aperto} &
    Cliente &
    (1, N) &
    \multirow{2}{\linewidth}{uno a molti} &
    \multirow{2}{\linewidth}{Data apertura: data} &
    \multirow{2}{\linewidth}{Data in cui il Ticket è stato aperto} \\ \cline{3-4}
      &   & Ticket & (1, 1) &   &   &   \\ \hline
    \multirow{2}{\linewidth}{Riparazione} &
    \multirow{2}{\linewidth}{Rappresenta quale Dispositivo è coinvolto nella riparazione} &
    Dispositivo &
    (0, N) &
    \multirow{2}{\linewidth}{uno a molti} &
    \multirow{2}{\linewidth}{} &
    \multirow{2}{\linewidth}{} \\ \cline{3-4}
      &   & Ticket & (1, 1) &   &   &   \\ \hline
    \multirow{2}{\linewidth}{Accesso} &
    \multirow{2}{\linewidth}{Rappresenta Utenti possono accedere ad un Ticket} &
    Utente &
    (1, N) &
    \multirow{2}{\linewidth}{molti a molti} &
    \multirow{2}{\linewidth}{} &
    \multirow{2}{\linewidth}{} \\ \cline{3-4}
      &   & Ticket & (1, N) &   &   &   \\ \hline
    \multirow{2}{\linewidth}{Gestione} &
    \multirow{2}{\linewidth}{Rappresenta quali Ticket un Punto di Accettazione ha in gestione} &
    PDA &
    (0, N) &
    \multirow{2}{\linewidth}{uno a molti} &
    \multirow{2}{\linewidth}{} &
    \multirow{2}{\linewidth}{} \\ \cline{3-4}
      &   & Ticket & (1, 1) &   &   &   \\ \hline
\end{tabularx}

\end{document}

Best Answer

With the help of the tabularray package:

enter image description here

\documentclass{report}
\usepackage{geometry}
\usepackage{tabularray}

\begin{document}
\noindent
{\footnotesize
\begin{tblr}{colspec={*{7}{X}}, row{1} = {font=\bfseries}, hlines, vlines, vspan=even, leftsep=3pt, rightsep=3pt} 
    Associazione &
    Descrizione &
    Entità coinvolte &
    Cardinalità Min/Max &
    Molteplicità &
    Attributi/ tipo &
    Descrizione attributi \\ 
    \SetCell[r=2]{}Apertura &
    \SetCell[r=2]{}Rappresenta quali Ticket il Cliente ha aperto &
    Cliente &
    (1, N) &
    \SetCell[r=2]{}uno a molti &
    \SetCell[r=2]{}Data apertura: data &
    \SetCell[r=2]{}Data in cui il Ticket è stato aperto \\ 
      &   & Ticket & (1, 1) &   &   &   \\ 
    \SetCell[r=2]{}Riparazione &
    \SetCell[r=2]{}Rappresenta quale Dispositivo è coinvolto nella riparazione &
    Dispositivo &
    (0, N) &
    \SetCell[r=2]{}uno a molti &
    \SetCell[r=2]{} &
    \SetCell[r=2]{} \\
      &   & Ticket & (1, 1) &   &   &   \\
    \SetCell[r=2]{}Accesso &
    \SetCell[r=2]{}Rappresenta Utenti possono accedere ad un Ticket &
    Utente &
    (1, N) &
    \SetCell[r=2]{}molti a molti &
    \SetCell[r=2]{} &
    \SetCell[r=2]{} \\
      &   & Ticket & (1, N) &   &   &   \\
    \SetCell[r=2]{}Gestione &
    \SetCell[r=2]{}Rappresenta quali Ticket un Punto di Accettazione ha in gestione &
    PDA &
    (0, N) &
    \SetCell[r=2]{}uno a molti &
    \SetCell[r=2]{} &
    \SetCell[r=2]{} \\
      &   & Ticket & (1, 1) &   &   &   \\
\end{tblr}}
\end{document}
Related Question