0

Could someone help me wrap the text in the first line of this table, it keeps exceeding the line width of the page and the \\ command doesn't work. Mainly the end three columns first row.

\begin{table}[H]
    \centering
    \begin{tabularx}{\linewidth}{X | X | X | X}
    
    \multicolumn{1}{c|}{\textit{\textbf{Photoresist}}}      & \multicolumn{1}{c|}{\textit{\textbf{Soft Bake Time at 95 \textdegree C}}}        & \multicolumn{1}{c|}{\textit{\textbf{Exposure Energy (mJ/cm\textsuperscript{2})}}}     & \multicolumn{1}{c}{\textit{\textbf{Post Exposure Bake Time at 95 \textdegree C}}}\tabularnewline \hline
        
    SU-8 2000.5  & 1760 & 1.5 & 0.4 \\ \hline
    SU-8 2002     & 1190 & 3.2 & 0.35 \\ 
    
    \end{tabularx}
    
\caption[Parameter properties for PVC and acrylic.]{Parameter properties for PVC and acrylic.}
\label{Parameter properties}   
\end{table}
1
  • The \multicolumn{1}{c|}{...} wrappers override the c column type.
    – Mico
    Oct 3, 2022 at 19:35

4 Answers 4

2

You can wrap text manually or auto.

\documentclass{article}
\usepackage{tabularray}
\begin{document}
\begin{table}[h]
\centering
\caption{Parameter properties for PVC and acrylic.}
\label{Parameter properties}
\begin{tblr}
{
colspec    = {*{4}{X[-1,c,m]}},
row{1}     = {font=\bfseries\itshape},
hline{1,Z} = {wd=.08em},
hline{2}   = {wd=.05em},
}
Photoresist & {Soft Bake\\Time at\\95 \textdegree C} & {Exposure\\Energy\\(mJ/cm\textsuperscript{2})} & {Post Exposure\\Bake Time at\\95 \textdegree C}\\
SU-8 2000.5 & 1760 & 1.5 & 0.4 \\
SU-8 2002 & 1190 & 3.2 & 0.35 \\
\end{tblr}
\end{table}
\begin{table}[h]
\centering
\caption{Parameter properties for PVC and acrylic.}
\label{Parameter properties}
\begin{tblr}
{
colspec    = {*{4}{X[-1,c,m]}},
row{1}     = {font=\bfseries\itshape},
hline{1,Z} = {wd=.08em},
hline{2}   = {wd=.05em},
}
Photoresist & Soft Bake Time at 95 \textdegree C & Exposure Energy (mJ/cm\textsuperscript{2}) & Post Exposure Bake Time at 95 \textdegree C\\
SU-8 2000.5 & 1760 & 1.5 & 0.4 \\
SU-8 2002 & 1190 & 3.2 & 0.35 \\
\end{tblr}
\end{table}
\end{document}

enter image description here

1

A small variation od @Clara answer (+1): introduced is use of thesiunitx package:

\usepackage{tabularray}
\UseTblrLibrary{siunitx}   % <---
\sisetup{per-mode=symbol}  % <---

\begin{document}
    \begin{table}[ht]
\caption{Parameter properties for PVC and acrylic.}
\label{Parameter properties}
\begin{tblr}{colspec    = {l    X[c]                          % <---
                           *{2}{X[c, si={table-format=1.2}]}},% <---
             row{1}     = {guard, font=\bfseries\itshape, m}, % <---
             hline{1,Z} = 1pt, hline{2}=solid,
            }
Photoresist &   {Soft Bake\\ Time at\\ \qty{95}{\celsius}}
                        &   Exposure Energy \normalfont(\unit{\milli\joule\per\square\cm})
                                    &   Post Exposure Bake Time at \qty{95}{\celsius}    \\
SU-8 2000.5 & 1760      & 1.5       & 0.4       \\
SU-8 2002   & 1190      & 3.2       & 0.35      \\
\end{tblr}
    \end{table}
\end{document}

enter image description here

0
\documentclass{article}

\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\begin{document}
\begin{table}
    \centering
    \begin{tabularx}{\linewidth}{X | X | X | X}
    
    \multicolumn{1}{Y|}{\textit{\textbf{Photoresist}}}      & \multicolumn{1}{Y|}{\textit{\textbf{Soft Bake Time at 95 \textdegree C}}}        & \multicolumn{1}{Y|}{\textit{\textbf{Exposure Energy (mJ/cm\textsuperscript{2})}}}     & \multicolumn{1}{Y}{\textit{\textbf{Post Exposure Bake Time at 95 \textdegree C}}}\tabularnewline \hline
        
    SU-8 2000.5  & 1760 & 1.5 & 0.4 \\ \hline
    SU-8 2002     & 1190 & 3.2 & 0.35 \\ 
    
    \end{tabularx}
    
\caption[Parameter properties for PVC and acrylic.]{Parameter properties for PVC and acrylic.}
\label{Parameter properties}   
\end{table}
\end{document}

enter image description here

0

Diagnostic: Unnecessary and harmful use of multi columns, that with the c style prevent wrapping text.

On the other hand, because the unequal headers and contents, it will look better with unequal columns using tabulary, where moreover is just easier set centered columns. BTW, it also will look better with booktabs (also without bold font, imho, with as this will change the constrains of the MWE, here you are with bold headers):

mwe

\documentclass{article}
\usepackage{tabulary, booktabs}
\begin{document}
\begin{tabulary}{\linewidth}{cCCC}\toprule
\bfseries\em Photoresist                        & 
\bfseries\em Soft Bake Time at 95\,°C           & 
\bfseries\em  Exposure Energy (mJ/cm²)          &
\bfseries\em  Post Exposure Bake Time at 95\,°C  \\\midrule
    SU-8 2000.5  & 1760 & 1.5 & 0.4 \\ 
    SU-8 2002     & 1190 & 3.2 & 0.35 \\\bottomrule 
\end{tabulary}
\end{document}
1
  • Thank you, this looks great!
    – user282214
    Oct 3, 2022 at 21:15

You must log in to answer this question.

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