1

I wrote a simple code to generate a simple table.

Here is my code:

\documentclass[a4paper,11pt,english]{report}

\usepackage{nicematrix}

\begin{document}

\begin{table} \begin{NiceTabular}{| p{0.2\linewidth} | p{0.4\linewidth} | p{0.4\linewidth} |} % Don't Modify \hline \textbf{\small{BLAA}}
& \textbf{\small{BLABLABLABL}}
& \textbf{\small{BLABLABLABLAB / BLAA BLAAAA}}
\ \hline JIRA Ticket gggggggg-190 & Second Column & Third Column
\ \hline \end{NiceTabular} % Don't Modify \end{table} % Don't Modify

\end{document}

The output pdf have a format issue at which there are many spaces between "JIRA" and "Ticket"

The output pdf:

enter image description here

Any help ?

Nour
  • 347
  • 1
    unrelated but size commands do not take an argument so \small{BLABLABLABL} should be \small BLABLABLABL by default p columns are justified you can set them ragged right with >{\raggedright\arraybackslash}p{..} – David Carlisle Dec 01 '21 at 10:25
  • 1
    also \begin{NiceTabular}{| p{0.2\linewidth} | p{0.4\linewidth} | p{0.4\linewidth} |} % Don't Modify this makes a table that is too wide as the you have 1\linewidth for the total text width on each column but you have \tabcolsep padding around each column and four | so you are 6\tabcolsep+4\arrayrulewidth too wide for the page. – David Carlisle Dec 01 '21 at 10:27
  • 1
    The table option p makes justified text, you could change it to left align. You can define \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} (see \flushleft with p{} option in tabular). – dexteritas Dec 01 '21 at 10:28
  • Put a \ just after Ticket and you are done. – Raffaele Santoro Dec 01 '21 at 11:24
  • 2
    Try \documentclass[a4paper,11pt]{report} \usepackage{nicematrix} \begin{document} { \newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{\dimexpr#1-2\tabcolsep-4\arrayrulewidth/3}} \noindent\begin{NiceTabular}{ L{0.3\linewidth} L{0.35\linewidth} L{0.35\linewidth} }[hvlines] \RowStyle{\small\bfseries} BLA & BLABLABLABL & BLABLABLABLAB / BLAA BLAAAA \\ JIRA Ticket gggggggg-190 & Second Column & Third Column \\ \end{NiceTabular} } \end{document} – Zarko Dec 01 '21 at 11:51

0 Answers0