适合表格*环境

适合表格*环境

我设法构建了一个可读的表格。

但是,我无法调整标题的宽度(附照片)。理想情况下,不适合的文本将移至下一行。您对此有什么建议吗?

在此处输入图片描述

这里是代码:

\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}

答案1

使用tabular*非常少见。另外,设置为 0pt 也确实不推荐。我建议将长表头分成两行,并在正常环境下\tabcolsep使用合理的值。\tabcolseptabular

以下应该可以做到。由于您没有提供使用过的类和包的完整代码示例,因此您的结果可能会略有不同。

如果仍然不适合,您可能需要稍微减小字体大小(\small)或者只是让表格进入边距.最后你可以缩小表格至\textwidth我们不推荐这样做,因为缩放文本看起来不太好,因为它会提供非标准的字体大小。

\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}

在此处输入图片描述

答案2

没有必要使用multirow,我发现声明要拆分哪些单元格更简单。

使用\addlinespace而不是\extrarowheight可以确保间距均匀。

我将第一列设置为左对齐并且不居中。

\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}

在此处输入图片描述

您还可以考虑siunitx。对于S列,特殊单元格内容必须用括号括起来。

\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}

在此处输入图片描述

答案3

一种变体,基于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}

您可能更喜欢使用\tabularx环境。以下是示例:添加到您的序言中

\usepackage{ragged2e,siunitx, tabularx}

并使用此代码:

\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}

在此处输入图片描述

在此处输入图片描述

相关内容