[Tex/LaTex] Set width column of a table with siunitx

siunitxtables

I would like to know how to set the column width even if I'm already defining the tabular with S. How can I define S and p at the same time?

enter image description here

\begin{table}[!h]
  \centering\renewcommand{\theadfont}{\small}
  \small\sisetup{per-mode=symbol}
  \setlength{\doublerulesep}{5pt}
  \rowcolors{3}{PalePink}{MyWhite}
  \begin{tabular}{|Cc||S[table-format=5.1]|S[table-format=3.1]|}
    \hhline{~--}
    \multicolumn{1}{c|}{} & {\thead{Molecular \\ weight \si{\g/\mol}}} & {\thead{Filterability \\ (\%)}} \\
    \hhline{-::==:}
    Water & 18 & 100 \\
    Sodium & 23 & 100 \\
    Chloride & 35.5 & 100 \\
    Potassium & 39 & 100 \\
    Urea & 60 & 100 \\
    Glucose & 180 & 100 \\
    Inulin & 5500 & 98 \\
    Myoglobin & 17000 & 75 \\
    Albumin & 69000 & 0.5 \\
    \hhline{-||--}
  \end{tabular}
    \caption{Molecular weight and filterability index of substances \cite{RefWorks:141}.}
  \label{ft_tab_ex}
\end{table}

Best Answer

You can set the width with table-column-width. As you did not provide a compilable MWE I had to guess the packages which you might use and remove a few things, such as the C columns, the colours etc.

\documentclass{article}

\usepackage{siunitx}
\usepackage[table]{xcolor}
\usepackage{makecell}
\usepackage{hhline}

\begin{document}


\begin{table}[!h]
  \centering\renewcommand{\theadfont}{\small}
  \small\sisetup{per-mode=symbol}
  \setlength{\doublerulesep}{5pt}
  \rowcolors{3}{red}{white}
  \begin{tabular}{|c||S[table-format=5.1,table-column-width=4cm]|S[table-format=3.1,table-column-width=4cm]|}
    \hhline{~--}
    & {\thead{Molecular \\ weight \si{\g/\mol}}} & {\thead{Filterability \\ (\%)}} \\
    \hhline{-::==:}
    Water & 18 & 100 \\
    Sodium & 23 & 100 \\
    Chloride & 35.5 & 100 \\
    Potassium & 39 & 100 \\
    Urea & 60 & 100 \\
    Glucose & 180 & 100 \\
    Inulin & 5500 & 98 \\
    Myoglobin & 17000 & 75 \\
    Albumin & 69000 & 0.5 \\
    \hhline{-||--}
  \end{tabular}
    \caption{Molecular weight and filterability index of substances \cite{RefWorks:141}.}
  \label{ft_tab_ex}
\end{table}


\end{document}