2

I managed to construct a readable table.

However, I do not manage to adjust the width of the headers (photo attached). Ideally, the text that does not fit will go to the next line. Would you have any suggestion on that?

enter image description here

Here the code:

\setlength\tabcolsep{0pt}
\setlength\extrarowheight{5pt}
\begin{table}
    \caption{tabular*}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} *{6}{c} }
    \toprule
        Reference         & Laminate      & Veil      & $\bar{c}$  & $G$\textsubscript{IC} vs. baseline     & $G$\textsubscript{IIC} vs. baseline \\
        \midrule
        \mr{Kuwata \cite{Kuwata2011, Kuwata2011a}} & Carbon/epoxy & \mr{CoPA} & \mr{21} & \mr{59} & \mr{1.14} \\
        &   Carbon/vynil ester     &        &        &        &   \\
        Barjasteh \cite{Barjasteh2017} & Carbon/benzoxazine & PA12 & 12 & 17 & 1.25   \\ 
        Saz-Orozco \cite{Saz-Orozco2015}    & Glass/vynil ester  & PA66 & 17 & 25 & 1.14 \\ 
        O'Donovan \cite{ODonovan2014}   & Glass/polyester & PA66 & 9 & 11.5 & 1.32 \\ 
        Ram\'irez \cite{Ramirez2015}    & Carbon/epoxy & PEEK & 9 & 11.5 & 1.32 \\ 
        Ni \cite{Ni2015}    & Carbon/epoxy & Aramid & 16 & 15 & 1.44 \\ 
        \mr{Kuwata \cite{Kuwata2011, Kuwata2011a}} & Carbon/epoxy & \mr{CoPE} & \mr{23} & \mr{12} & \mr{1.38} \\
        &   Carbon/vynil ester     &        &        &        &   \\
        Wong \cite{Wong2017}    & Carbon/epoxy & Kevlar & 26 & 12 & 1.44 \\ 
        Fitzmaurize \cite{Fitzmaurice2016}  & Glass/polyester & PET & 45 & 20 & 1.41 \\ 
        Saz-Orozco \cite{Saz-Orozco2015}    & Glass/vynil ester & PET & 45 & 20 & 1.41  \\ 
        \mr{Beylergil \cite{Beylergil2018}} & \mr{Carbon/epoxy} & \mr{PA66} & 17 & \mr{19.90} & \mr{1.14} \\
        &       &        &   50     &        &   \\
        \mr{Ram\'irez \cite{Ramirez2015}} & \mr{Carbon/epoxy} & \mr{PPS} & 7 to 35 & 10 & \mr{1.30} \\
        &       &        &   8 to 22     &   14     &   \\  
        \bottomrule
    \end{tabular*}
\end{table}
2

Using tabular* is very uncommon. Also setting \tabcolsep to 0pt is really not recommended. I recommend to break the long table headers into two lines and use a reasonable value of \tabcolsep with the normal tabular environment.

The following should do it. As you didn't provided a full code example with the used class and packages your results may vary a little.

If it still does not fit you might want to decrease the font size a little (\small) or just let the table go into the margin. Finally you could shrink the table to \textwidth which is not recommended because scaling text doesn't look good as it gives non-standard font sizes.

\documentclass{article}
\usepackage{array}
\usepackage{booktabs}

\usepackage{blindtext}% for example text only

\newcommand\mr{}

\begin{document}

\blindtext

\setlength\tabcolsep{4.4pt}
\setlength\extrarowheight{5pt}
\begin{table}
   \setlength\belowcaptionskip{\abovecaptionskip}
   \setlength\abovecaptionskip{0pt}
\centering
    \caption{tabular}

\begin{tabular}{*{6}{c} }
    \toprule
        Reference         & Laminate      & Veil      & $\bar{c}$  & $G$\textsubscript{IC}  vs.{}    & $G$\textsubscript{IIC} vs.{}  \\
                  &        &        &    & baseline     &  baseline \\
        \midrule
        \mr{Kuwata \cite{Kuwata2011, Kuwata2011a}} & Carbon/epoxy & \mr{CoPA} & \mr{21} & \mr{59} & \mr{1.14} \\
        &   Carbon/vynil ester     &        &        &        &   \\
        Barjasteh \cite{Barjasteh2017} & Carbon/benzoxazine & PA12 & 12 & 17 & 1.25   \\ 
        Saz-Orozco \cite{Saz-Orozco2015}    & Glass/vynil ester  & PA66 & 17 & 25 & 1.14 \\ 
        O'Donovan \cite{ODonovan2014}   & Glass/polyester & PA66 & 9 & 11.5 & 1.32 \\ 
        Ram\'irez \cite{Ramirez2015}    & Carbon/epoxy & PEEK & 9 & 11.5 & 1.32 \\ 
        Ni \cite{Ni2015}    & Carbon/epoxy & Aramid & 16 & 15 & 1.44 \\ 
        \mr{Kuwata \cite{Kuwata2011, Kuwata2011a}} & Carbon/epoxy & \mr{CoPE} & \mr{23} & \mr{12} & \mr{1.38} \\
        &   Carbon/vynil ester     &        &        &        &   \\
        Wong \cite{Wong2017}    & Carbon/epoxy & Kevlar & 26 & 12 & 1.44 \\ 
        Fitzmaurize \cite{Fitzmaurice2016}  & Glass/polyester & PET & 45 & 20 & 1.41 \\ 
        Saz-Orozco \cite{Saz-Orozco2015}    & Glass/vynil ester & PET & 45 & 20 & 1.41  \\ 
        \mr{Beylergil \cite{Beylergil2018}} & \mr{Carbon/epoxy} & \mr{PA66} & 17 & \mr{19.90} & \mr{1.14} \\
        &       &        &   50     &        &   \\
        \mr{Ram\'irez \cite{Ramirez2015}} & \mr{Carbon/epoxy} & \mr{PPS} & 7 to 35 & 10 & \mr{1.30} \\
        &       &        &   8 to 22     &   14     &   \\  
        \bottomrule
    \end{tabular}
\end{table}

\blindtext

\end{document}

enter image description here

| improve this answer | |
  • There's too much space between the first and the second row of the header, in my opinion, I would use \makecell. – CarLaTeX Jan 30 '19 at 15:57
  • Dear Martin. Thanks for your answer. What if I want to keep writing text in the same cell (your solution is very useful for the short example that I posted, but for longer sentenes the words keep moving away from the cell). – Santi Jan 30 '19 at 16:10
3

There's no need to use multirow, I find it simpler to declare what cells have to be split.

Using \addlinespace instead of \extrarowheight ensures uniform spacing.

I set the first column flush left and no centered.

\documentclass{article}
\usepackage{booktabs,makecell}

\newcommand{\splitcell}[1]{%
  \begin{tabular}{@{}c@{}}#1\end{tabular}%
}

\begin{document}

\begin{table}
% local settings
\setlength\tabcolsep{0pt}

\caption{tabular*}

\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l *{5}{c} @{}}
\toprule
Reference & Laminate & Veil & $\bar{c}$ &
  \splitcell{$G_{\mathrm{IC}}$ vs. \\ baseline} &
  \splitcell{$G_{\mathrm{IIC}}$ vs. \\ baseline} \\
\midrule
Kuwata \cite{Kuwata2011, Kuwata2011a} &
  \splitcell{Carbon/epoxy \\ Carbon/vynil ester} &
  CoPA & 21 & 59 & 1.14 \\
\addlinespace
Barjasteh \cite{Barjasteh2017} &
  Carbon/benzoxazine &
  PA12 & 12 & 17 & 1.25   \\ 
\addlinespace
Saz-Orozco \cite{Saz-Orozco2015} &
  Glass/vynil ester &
  PA66 & 17 & 25 & 1.14 \\ 
\addlinespace
O'Donovan \cite{ODonovan2014} &
  Glass/polyester &
  PA66 & 9 & 11.5 & 1.32 \\ 
\addlinespace
Ram\'irez \cite{Ramirez2015} &
  Carbon/epoxy &
  PEEK & 9 & 11.5 & 1.32 \\ 
\addlinespace
Ni \cite{Ni2015} &
  Carbon/epoxy &
  Aramid & 16 & 15 & 1.44 \\ 
\addlinespace
Kuwata \cite{Kuwata2011, Kuwata2011a} &
  \splitcell{Carbon/epoxy \\ Carbon/vynil ester} &
  CoPE & 23 & 12 & 1.38 \\
\addlinespace
Wong \cite{Wong2017} &
  Carbon/epoxy &
  Kevlar & 26 & 12 & 1.44 \\ 
\addlinespace
Fitzmaurize \cite{Fitzmaurice2016} &
  Glass/polyester &
  PET & 45 & 20 & 1.41 \\ 
\addlinespace
Saz-Orozco \cite{Saz-Orozco2015} &
  Glass/vynil ester &
  PET & 45 & 20 & 1.41  \\ 
\addlinespace
Beylergil \cite{Beylergil2018} &
  Carbon/epoxy &
  PA66 & \splitcell{17 \\ 50} & 19.90 & 1.14 \\
\addlinespace
Ram\'irez \cite{Ramirez2015} &
  Carbon/epoxy &
  PPS & \splitcell{7 to 35 \\ 8 to 22} & 10 & 1.30 \\
\bottomrule
\end{tabular*}

\end{table}

\end{document}

enter image description here

You can also consider siunitx. In the case of S columns, special cell contents has to be braced.

\documentclass{article}
\usepackage{booktabs,siunitx}

\newcommand{\splitcell}[2][c]{%
  \begin{tabular}{@{}#1@{}}#2\end{tabular}%
}

\begin{document}

\begin{table}
% local settings
\setlength\tabcolsep{0pt}

\caption{tabular*}

\begin{tabular*}{\textwidth}{
  @{\extracolsep{\fill}}
  l
  c
  c
  S[table-format=2.0]
  S[table-format=2.2]
  S[table-format=1.2]
  @{}
}
\toprule
Reference & Laminate & Veil & $\bar{c}$ &
  {\splitcell{$G_{\mathrm{IC}}$ vs. \\ baseline}} &
  {\splitcell{$G_{\mathrm{IIC}}$ vs. \\ baseline}} \\
\midrule
Kuwata \cite{Kuwata2011, Kuwata2011a} &
  \splitcell{Carbon/epoxy \\ Carbon/vynil ester} &
  CoPA & 21 & 59 & 1.14 \\
\addlinespace
Barjasteh \cite{Barjasteh2017} &
  Carbon/benzoxazine &
  PA12 & 12 & 17 & 1.25   \\ 
\addlinespace
Saz-Orozco \cite{Saz-Orozco2015} &
  Glass/vynil ester &
  PA66 & 17 & 25 & 1.14 \\ 
\addlinespace
O'Donovan \cite{ODonovan2014} &
  Glass/polyester &
  PA66 & 9 & 11.5 & 1.32 \\ 
\addlinespace
Ram\'irez \cite{Ramirez2015} &
  Carbon/epoxy &
  PEEK & 9 & 11.5 & 1.32 \\ 
\addlinespace
Ni \cite{Ni2015} &
  Carbon/epoxy &
  Aramid & 16 & 15 & 1.44 \\ 
\addlinespace
Kuwata \cite{Kuwata2011, Kuwata2011a} &
  \splitcell{Carbon/epoxy \\ Carbon/vynil ester} &
  CoPE & 23 & 12 & 1.38 \\
\addlinespace
Wong \cite{Wong2017} &
  Carbon/epoxy &
  Kevlar & 26 & 12 & 1.44 \\ 
\addlinespace
Fitzmaurize \cite{Fitzmaurice2016} &
  Glass/polyester &
  PET & 45 & 20 & 1.41 \\ 
\addlinespace
Saz-Orozco \cite{Saz-Orozco2015} &
  Glass/vynil ester &
  PET & 45 & 20 & 1.41  \\ 
\addlinespace
Beylergil \cite{Beylergil2018} &
  Carbon/epoxy &
  PA66 & {\splitcell[r]{17 \\ 50}} & 19.90 & 1.14 \\
\addlinespace
Ram\'irez \cite{Ramirez2015} &
  Carbon/epoxy &
  PPS & {\splitcell{\numrange{7}{35} \\ \numrange{8}{22}}} & 10 & 1.30 \\
\bottomrule
\end{tabular*}

\end{table}

\end{document}

enter image description here

| improve this answer | |
1

A variant, based on makecell:

\documentclass{article}%{table-sep}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness} {0.3pt}
\usepackage{amsmath}
\usepackage{array, booktabs, makecell, caption}

\newcommand{\mr}{\relax}

\begin{document}
%
\setlength\tabcolsep{4pt}
\setlength\extrarowheight{5pt}
\begin{table}
\centering
    \caption{tabular + makecell}
\begin{tabular}{ *{6}{c} }
    \toprule
        Reference & Laminate & Veil & $\bar{c}$ & \makecell{$G_\text{IC}$ vs. \\ baseline} & \makecell{$G_\text{IIC}$ vs. \\ baseline} \\
        \midrule
        \mr{Kuwata \cite{Kuwata2011, Kuwata2011a}} & Carbon/epoxy & \mr{CoPA} & \mr{21} & \mr{59} & \mr{1.14} \\
        & Carbon/vynil ester & & & & \\
        Barjasteh \cite{Barjasteh2017} & Carbon/benzoxazine & PA12 & 12 & 17 & 1.25 \\
        Saz-Orozco \cite{Saz-Orozco2015} & Glass/vynil ester & PA66 & 17 & 25 & 1.14 \\
        O'Donovan \cite{ODonovan2014} & Glass/polyester & PA66 & 9 & 11.5 & 1.32 \\
        Ramírez \cite{Ramirez2015} & Carbon/epoxy & PEEK & 9 & 11.5 & 1.32 \\
        Ni \cite{Ni2015} & Carbon/epoxy & Aramid & 16 & 15 & 1.44 \\
        \mr{Kuwata \cite{Kuwata2011, Kuwata2011a}} & Carbon/epoxy & \mr{CoPE} & \mr{23} & \mr{12} & \mr{1.38} \\
        & Carbon/vynil ester & & & & \\
        Wong \cite{Wong2017} & Carbon/epoxy & Kevlar & 26 & 12 & 1.44 \\
        Fitzmaurize \cite{Fitzmaurice2016} & Glass/polyester & PET & 45 & 20 & 1.41 \\
        Saz-Orozco \cite{Saz-Orozco2015} & Glass/vynil ester & PET & 45 & 20 & 1.41 \\
        \mr{Beylergil \cite{Beylergil2018}} & \mr{Carbon/epoxy} & \mr{PA66} & 17 & \mr{19.90} & \mr{1.14} \\
        & & & 50 & & \\
        \mr{Ramírez\cite{Ramirez2015}} & \mr{Carbon/epoxy} & \mr{PPS} & 7 to 35 & 10 & \mr{1.30} \\
        & & & 8 to 22 & 14 & \\
        \bottomrule
    \end{tabular}
\end{table}

\end{document}

You might prefer to use a \tabularx environment. Here is an example: add to your preamble

\usepackage{ragged2e,siunitx, tabularx}

and use this code:

\setlength\tabcolsep{4pt} \setlength\extrarowheight{5pt} 
\begin{table} \centering \caption{tabular + makecell} 
\begin{tabularx}{\linewidth}{c>{\Centering}X*{4}{c} } 
\toprule 
Reference & Laminate & Veil & \makecell{$\bar{\beta}$ \\(\si{g\per\square m})} & \makecell{$\omega$\\ (\si{\um})} & \makecell{$\rho$ \\(\si{g\per m\cubed })} \\ \midrule Kuwata \cite{Kuwata2011, Kuwata2011a} & Carbon/epoxy (non-crimp and plain-weave fabrics) & \mr{CoPA} & \mr{21} & \mr{59} & 1.14 \\ \bottomrule 
\end{tabularx} 
\end{table}

enter image description here

enter image description here

| improve this answer | |
  • That one is awesome! Now everything looks good inside the table. However the table itself is uncentred on the page. Would you kindly have any suggestion? – Santi Jan 30 '19 at 17:56
  • Normally, it is centred w.r.t. the margins (see the page frame in the image).vuia the directive \centering – unless your preamble inhibits this for some reason. Could you post a minimal example showing the problem? – Bernard Jan 30 '19 at 18:02
  • \setlength\tabcolsep{4pt} \setlength\extrarowheight{5pt} \begin{table} \centering \caption{tabular + makecell} \begin{tabular}{ *{6}{c} } \toprule Reference & Laminate & Veil & $\bar{\beta}$ (g/m\textsuperscript{2}) & $\omega$ ($\mu$m) & $\rho$ (g/m\textsuperscript{3}) \\ \midrule Kuwata \cite{Kuwata2011, Kuwata2011a} & \makecell{Carbon/epoxy (non-crimp \\ and plain-weave fabrics)} & \mr{CoPA} & \mr{21} & \mr{59} & 1.14 \\ \bottomrule \end{tabular} \end{table} – Santi Jan 30 '19 at 18:13
  • @Santi: I've posted a solution based on tabularx and ragged2e. I added siunitx to have more correct units (the symbol for micro is not an ordinary mu), simpler to type. – Bernard Jan 30 '19 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.