3

I followed this post to make the following code:

\begin{table}[h!]
    \centering
    \begin{tabularx}{\textwidth}{|c|c|c|c|c|c|}
         \hline A &  B & C & D & E & F \\ \hline  AA &  BB & CC & blablabla blibli blobloblo blslklqs blablabla blibli blobloblo blslklqs  blablabla blibli blobloblo blslklqs & \cite{urdampilleta2019gate}  \\ \hline
    \end{tabularx}
\end{table}

However I do not have a line break as one can see below. enter image description here

Where is my mistake and how can I fix it ?

2
  • 3
    If you're going to use a tabularx environment, at least one column should have type X.
    – Mico
    Commented Oct 1, 2021 at 19:06
  • you are specifying c columns they are always single line. Commented Oct 1, 2021 at 19:34

2 Answers 2

5

a

Needs an X column. (Also a missing & after the \cite. It helps aligning the & of the rows.)

\documentclass[12pt,a4paper]{article}

\usepackage{tabularx}

\begin{document}
    
\begin{table}[h!]
    \begin{tabularx}{\textwidth}{|c|c|c|X|c|c|}
        \hline
            A&B     &C  &D  &E                          &F\\
        \hline
           AA&BB    &CC &blablabla blibli blobloblo blslklqs blablabla blibli blobloblo blslklqs  blablabla blibli blobloblo blslklqs       
                           &\cite{urdampilleta2019gate}&\\
         \hline
    \end{tabularx}
\end{table}

\end{document}
1
  • +1. Lose the \centering instruction, though, as it's redundant.
    – Mico
    Commented Oct 1, 2021 at 19:07
1

For fun and exercise ... by use of the tabularray (version 2021N) package:

\documentclass[12pt,a4paper]{article}
\usepackage{tabularray}

\usepackage{lipsum}

\begin{document}

\begin{table}[ht]
    \begin{tblr}{hlines, vlines,
                 colspec={cc c X[j] cc},
                 }
 A  & B & C & D & E & F     \\
AA  &BB &CC & \lipsum[66]
                & \cite{urdampilleta2019gate}
                    &       \\
    \end{tblr}
\end{table}

\end{document}

enter image description here

You must log in to answer this question.