Sorry I tried to see other answers but I can't solve the issue. My table is out of margin. This is the code:
\centering
\begin{tabularx}{\linewidth}{lXX}
\rowcolor{cyan} \multicolumn{2}{c}{\textit{\textbf{USE CASE #1}}} & \multicolumn{1}{c}{\textit{\textbf{Improvements of a subject}}} \tabularnewline
\textbf{Goal context} & \multicolumn{2}{|c|}{Conoscere gli sviluppi di una materia} \tabularnewline \midrule
\textbf{Preconditions} & \multicolumn{2}{c}{Lo studente deve aver svolto almeno due esercizi di una stessa materia} \tabularnewline \midrule
\textbf{Success end condition} & \multicolumn{2}{c}{Lo studente viene a conoscenza degli sviluppi di una materia} \tabularnewline \midrule
\textbf{Failed end condition} & \multicolumn{2}{c}{ la macchina non trova i valori richiesti o \newline lo studente ha svolto meno die due esercizi }\tabularnewline \midrule
\textbf{Primary Actor} & \multicolumn{2}{|c|}{Lo studente} \tabularnewline \midrule
\textbf{Trigger} & \multicolumn{2}{|c|}{Lo studente tramite comando vocale seleziona l'opzione dal menù} \tabularnewline \bottomrule
\rowcolor{cyan} \multicolumn{3}{c}{\textit{\textbf{Descrizione}}} \tabularnewline
\rowcolor{cyan} \textbf{Step} & \textbf{Studente} & \textbf{Sistema}
\end{tabularx}
\caption{tabularx-version with booktabs: Brief overview of all economic schools and their understanding of cyclical drivers.\cite{BormotovMichael2009}}
\label{table:economicSchools3}
\end{table}

\small, see https://tex.stackexchange.com/questions/332902/my-table-doesnt-fit-what-are-my-options/332903#332903 – David Carlisle Jun 07 '22 at 21:07\multicolumn{2}{c}{ la macchina non trova i valori richiesti o \newline lo studente ha svolto meno die due esercizi }can not work, acentry is single line. – David Carlisle Jun 07 '22 at 21:09\mulicolumn{2}{p{3cm}or a nestedtabular– David Carlisle Jun 07 '22 at 21:26