2

Here a very easy table (or al least i thought it was) in my article document. It overflows to the right, i've tried everything i've found on the net, still overflows... cannot understand what's happening.

   \begin{table}[!ht]
        \centering
        \begin{tabular}{c || l}
            \hline
            \textbf{Date} & \textbf{Event} \\ \hline
            2023-05-09 & A component of our CPU validation pipeline generates an anomalous result. \\ \hline
            2023-05-12 & We successfully isolate and reproduce the issue. Investigation continues. \\ \hline
            2023-05-14 & We are now aware of the scope and severity of the issue.  \\ \hline
            2023-05-15 & We draft a brief status report and share our findings with AMD PSIRT. \\ \hline
            2023-05-17 & AMD acknowledge our report and confirm they can reproduce the issue. \\ \hline
            2023-05-17 & We complete development of a reliable PoC and share it with AMD. \\ \hline
            2023-05-19 & We begin to notify major kernel and hypervisor vendors. \\ \hline
            2023-05-23 & We receive a beta microcode update for Rome from AMD. \\ \hline
            2023-05-24 & We confirm the update fixes the issue and notify AMD. \\ \hline
            2023-05-30 & AMD inform us they have sent a SN (security notice) to partners. \\ \hline
            2023-06-12 & Meeting with AMD to discuss status and details. \\ \hline
            2023-07-20 & AMD unexpectedly publish patches, earlier than an agreed embargo date. \\ \hline
            2023-07-21 & As the fix is now public, we propose privately notifying major distributions that they should begin preparing updated firmware packages. \\ \hline
            2023-07-24 & Public disclosure. \\ \hline
        \end{tabular}
    \end{table}

Here all packages i'm using

\documentclass{article}

\usepackage{graphicx}
\usepackage{layout}
\graphicspath{ {./images/} }
\usepackage{watermark}
\usepackage[export]{adjustbox}
\usepackage{fancyhdr}
\usepackage{minted} %per gli snippet
\usepackage{xcolor}
\pagestyle{fancy}
\usepackage{wrapfig}
\usepackage[hidelinks]{hyperref}
\usepackage{eurosym}
\usepackage{placeins} %per float barrier
\usepackage{float}
\usepackage{caption}
\usepackage{wrapfig}
\usepackage[
backend=biber,
style=numeric,
sorting=ynt,
maxalphanames=20
]{biblatex}
\addbibresource{biblio.bib}

thanks

3
  • 1
    By default, the l (and c and r) column types don't have line breaking at all, so it will overflow to the right. Look for how to define column types that have a set width. Or look into tabularx. As a separate matter, look at how booktabs recommends to create a table.
    – Teepeemm
    Commented Jul 10 at 21:39
  • so, what column types has line breaking...? Commented Jul 10 at 21:41
  • 1
    p{4cm} would make a column with line breaking to a width of 4cm Commented Jul 10 at 21:49

2 Answers 2

5

I suggest you employ a tabularx environment (provided by the tabularx package), set its target width to \textwidth, and employ the X column type for the second column, in order to allow for automatic line breaking. You can continue to use the l column type for the first column.

I'd also load the booktabs package and use its user macros to generate just a few, but well-spaced, horizontal rules.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage[english]{babel}
\usepackage{tabularx} % for 'tabularx' environment and 'X' column type
\usepackage{ragged2e} % for '\RaggedRight' macro (suppress full justification)
\usepackage{booktabs} % for '\toprule', '\midrule', and '\bottomrule' macros

\begin{document}

\begin{table}[ht]

\begin{tabularx}{\textwidth}{@{} l >{\RaggedRight}X @{}}
\toprule
Date & Event \\ 
\midrule
2023-05-09 & A component of our CPU validation pipeline generates an anomalous result. \\ 
2023-05-12 & We successfully isolate and reproduce the issue. Investigation continues. \\ 
2023-05-14 & We are now aware of the scope and severity of the issue.  \\ 
2023-05-15 & We draft a brief status report and share our findings with AMD PSIRT. \\ 
2023-05-17 & AMD acknowledge our report and confirm they can reproduce the issue. \\ 
2023-05-17 & We complete development of a reliable PoC and share it with AMD. \\ 
2023-05-19 & We begin to notify major kernel and hypervisor vendors. \\ 
2023-05-23 & We receive a beta microcode update for Rome from AMD. \\ 
2023-05-24 & We confirm the update fixes the issue and notify AMD. \\ 
2023-05-30 & AMD inform us they have sent a SN (security notice) to partners. \\ 
2023-06-12 & Meeting with AMD to discuss status and details. \\ 
2023-07-20 & AMD unexpectedly publish patches, earlier than an agreed embargo date. \\ 
2023-07-21 & As the fix is now public, we propose privately notifying major distributions that they should begin preparing updated firmware packages. \\ 
2023-07-24 & Public disclosure. \\ 
\bottomrule
\end{tabularx}

\end{table}

\end{document}
1
  • thanks! That worked, don't know why similar answers i found didnt work... tnx Commented Jul 11 at 19:24
1

As supplement to nice @Mico answer, below is solution where is use tabularray package which also define X columns type which can employ several option for aligning text in them, define columns mode, font size etc. (for details see package documentation).

Below are shown two cases of use X columns:

  • with option when text in cells is right raged: X[l]
  • and option when text in cells is justified: X[j]

In the both cases I suggest to squeeze line spread for a wee bit to get better visual separation between rows.

\documentclass{article} 
\usepackage[english]{babel}
\usepackage{tabularray}   
\UseTblrLibrary{booktabs} 

\begin{document}
    \begin{table}[ht]
\begin{tblr}{colspec = {@{} l X[l] @{}},
             cells   = {font=\normalfont\linespread{0.92}\selectfont}
             }
    \toprule
Date & Event \\ 
    \midrule
2023-05-09 & A component of our CPU validation pipeline generates an anomalous result. \\ 
2023-05-12 & We successfully isolate and reproduce the issue. Investigation continues. \\ 
2023-05-14 & We are now aware of the scope and severity of the issue.  \\ 
2023-05-15 & We draft a brief status report and share our findings with AMD PSIRT. \\ 
2023-05-17 & AMD acknowledge our report and confirm they can reproduce the issue. \\ 
2023-05-17 & We complete development of a reliable PoC and share it with AMD. \\ 
2023-05-19 & We begin to notify major kernel and hypervisor vendors. \\ 
2023-05-23 & We receive a beta microcode update for Rome from AMD. \\ 
2023-05-24 & We confirm the update fixes the issue and notify AMD. \\ 
2023-05-30 & AMD inform us they have sent a SN (security notice) to partners. \\ 
2023-06-12 & Meeting with AMD to discuss status and details. \\ 
2023-07-20 & AMD unexpectedly publish patches, earlier than an agreed embargo date. \\ 
2023-07-21 & As the fix is now public, we propose privately notifying major distributions that they should begin preparing updated firmware packages. \\ 
2023-07-24 & Public disclosure. \\ 
    \bottomrule
\end{tblr}
    \end{table}
\end{document}

which gives:

enter image description here

For the second case just replace X[l] with X[j] and result is:

enter image description here

You must log in to answer this question.

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