0

I would like to increase the row height to properly show the fraction of N2O/SiH4 in the table (see attached image). Also, I would like the last column not to increase width according to the pagewidth. As I am using multiple tables in this report, I would like to be able to specifiy for each specific table. Please let me know if the question remains unclear to you after seeing my MWE.

\documentclass{report}        
%\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{changes}
\usepackage{caption}
\usepackage[justification=centering]{caption}
\usepackage{amssymb}
\usepackage[gen]{eurosym}  %proper euro sign
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{bm} % for \bm macro
\usepackage{mhchem}  %allows chemical formulae
\usepackage{siunitx} %allow SI units
\usepackage{cleveref} %smart referencing, automatic sorting etc.
\usepackage{nomencl}
\usepackage{pdfpages}
\makenomenclature 

\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{array}
\usepackage{colortbl}
\tcbuselibrary{skins}
\tcbset{tab2/.style={enhanced,fonttitle=\bfseries,fontupper=\normalsize\sffamily,
colback=yellow!10!white,colframe=tudelft-sky-blue,
coltitle=black,center title}} 

\begin{document}


    \begin{tcolorbox}[tab2,tabularx={Y||Y|Y|Y}]
        \caption{Oxide fraction estimated by weighing method}
    $\bm{\frac{\ce{N2O}}{\ce{SiH4}}}$   & \textbf{Deposition time(min)} & \textbf{Stoichiometry}                & \textbf{Oxygen fraction(\%)}  \\\hline\hline
            $\frac{200}{600}$           & 90                            &  SiO$_\textrm{\scriptsize 0.72}$      & 42                            \\\hline
            $\frac{200}{600} $          & 120                           &  SiO$_\textrm{\scriptsize 0.81}$      & 45                            \\\hline
            $\frac{250}{600} $          & 90                            &  SiO$_\textrm{\scriptsize 0.71}$      & 42                            \\\hline
            $\frac{250}{600} $          & 120                           &  SiO$_\textrm{\scriptsize 0.80}$      & 44                            \\\hline
            $\frac{300}{600} $          & 90                            &  SiO$_\textrm{\scriptsize 0.52}$      & 34                            \\\hline
            $\frac{300}{600} $          & 120                           &  SiO$_\textrm{\scriptsize 0.65}$      & 39                            \\\hline
            $\frac{350}{600} $          & 90                            &  SiO$_\textrm{\scriptsize 0.71}$      & 42                            \\\hline
            $\frac{350}{600} $          & 120                           &  SiO$_\textrm{\scriptsize 0.76}$      & 43                            \\
            \label{tab:oxidefraction_weighingmethod}
            \end{tcolorbox}

\end{document}

table

1
  • And what is the ` Y` column type, if you don't mind?
    – Bernard
    Commented Apr 12, 2018 at 11:53

1 Answer 1

1

Not knowing what is the Y column type, nor the tudelft-sky-blue colour, I propose an approximation with this solution based on the \setcellgapes and \theadcommands from makecell. I also simplified your preamble, as some packages are already loaded by others.

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames, table]{xcolor}
\colorlet{tudelft-sky-blue}{SkyBlue}
\usepackage{changes}
\usepackage{caption}
\usepackage[justification=centering]{caption}
\usepackage{amssymb}
\usepackage[gen]{eurosym} %proper euro sign
\usepackage{mathtools, nccmath}
\usepackage{bm} % for \bm macro
\usepackage{mhchem} %allows chemical formulae
\usepackage{siunitx} %allow SI units
\usepackage{cleveref} %smart referencing, automatic sorting etc.
\usepackage{nomencl}
\usepackage{pdfpages}
\makenomenclature

\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{makecell}
\tcbuselibrary{skins}
\tcbset{tab2/.style={enhanced,fonttitle=\bfseries,fontupper=\normalsize\sffamily,
colback=yellow!10!white,colframe=tudelft-sky-blue,
coltitle=black,center title}}

\begin{document}

\setcellgapes{3pt}\makegapedcells
\renewcommand{\theadfont}{\normalsize\bfseries}
    \begin{tcolorbox}[tab2,tabularx={>{\centering\arraybackslash}X||c|c|c}]
        \captionof{table}{Oxide fraction estimated by weighing method}
   \boldmath ${\mfrac{\ce{N2O}}{\ce{SiH4}}}$ & \thead{Deposition\\ time(min)} & \thead{Stoichiometry} & \thead{Oxygen\\ fraction(\%)} \\\hline\hline
            $\mfrac{200}{600}$ & 90 & SiO$_\textrm{\scriptsize 0.72}$ & 42 \\\hline
            $\mfrac{200}{600} $ & 120 & SiO$_\textrm{\scriptsize 0.81}$ & 45 \\\hline
            $\mfrac{250}{600} $ & 90 & SiO$_\textrm{\scriptsize 0.71}$ & 42 \\\hline
            $\mfrac{250}{600} $ & 120 & SiO$_\textrm{\scriptsize 0.80}$ & 44 \\\hline
            $\mfrac{300}{600} $ & 90 & SiO$_\textrm{\scriptsize 0.52}$ & 34 \\\hline
            $\mfrac{300}{600} $ & 120 & SiO$_\textrm{\scriptsize 0.65}$ & 39 \\\hline
            $\mfrac{350}{600} $ & 90 & SiO$_\textrm{\scriptsize 0.71}$ & 42 \\\hline
            $\mfrac{350}{600} $ & 120 & SiO$_\textrm{\scriptsize 0.76}$ & 43
            \label{tab:oxidefraction_weighingmethod}
            \end{tcolorbox}

\end{document}

enter image description here

You must log in to answer this question.

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