1

I am trying to make this table look nicer, I've tried the >{\hsize=.85\hsize} trick, but can't get it last part to be short. I am almost sure there is more elegant solution. Basically I need the last three columns to be equally spaced and almost-same-size.

(arbitrary margin just to match my institution requirements without loading custom packages) MWE:

\documentclass[,a4paper]{memoir}
\usepackage[adobe-utopia]{mathdesign}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tabularx}
\usepackage{threeparttable}
\usepackage{booktabs}
\usepackage[margin=3.8cm]{geometry}
%***********************Document*******************
\begin{document}
    \begin{threeparttable}{\small 
            \linespread{1.3}\selectfont{}
            \begin{tabularx}{\textwidth}{@{}XXXX@{}}\toprule
                Factor & Low & Medium & High\\
                \midrule
                Physiochemical & & &\\ 
                \hspace{1em}Smothing abc.\ & Molecular flow & Molecular flow & Continuum flow \\ 
                \hspace{1em}Sticking coef.\ & Reversible adsorption & Adsorption & High eff.\ adsorption\\ 
                \hspace{1em}Available mol.\ & Insufficient coverage & Surface saturation & {Precursor waste \tnote{$\dagger$}}\\
                \addlinespace[1ex] %\hdashline
                \midrule
                Processing &  &  & \\ 
                %\cmidrule(){1-1}
                \hspace{1em}{Temperature} & {Condensation} & {Adsorption} & {Desorption \tnote{$\star$}}\\ 
                \hspace{1em}Pressure & Poor precursor carrier & Balanced & Lower interdiffusion\\ 
                \hspace{1em}Exposure time & Insufficient coverage & Complete coverage & Longer cycle\\
            \bottomrule
    \end{tabularx}}

    \begin{tablenotes}
        \item[$\dagger$] Another thing.
        \item[$\star$] Something.
        \item Source: BBQ.
    \end{tablenotes}
\end{threeparttable}

\end{document}

Desired result like this:

desired table with annonations

I have read through a lot of questions, specially this and this other one. Most questions seem to related either to, multicolumn, long table, or number-content tables, which is not my case.

G. Bay
  • 2,047

1 Answers1

1

Based on the annotated screenshot you posted, it looks like you want equal amounts of whitespace between the columns and no whitespace to the right of the final column. A tabular* environment lets you achieve these formatting objectives.

enter image description here

\documentclass[a4paper]{memoir}
\usepackage[adobe-utopia]{mathdesign}
%%\usepackage[utf8]{inputenc} % that's the default nowadays
\usepackage[T1]{fontenc}
\usepackage{array}
\newcommand\mc[1]{\multicolumn{1}{@{}l}{#1}} % handy shortcut macro

\usepackage[flushleft]{threeparttable} \usepackage{booktabs} \usepackage[margin=3.8cm]{geometry}

\begin{document}

\noindent \begin{threeparttable} %% \small % not needed \setlength\tabcolsep{0pt} % default: 6pt \linespread{1.15} % "\linespread{1.3}" seems excessive \begin{tabular}{\textwidth}{@{\extracolsep{\fill}} >{\quad}l lll } \toprule \mc{Factor} & Low & Medium & High\ \midrule \mc{Physiochemical} \ Smoothing abc.\ & Molecular flow & Molecular flow & Continuum flow \ Sticking coeff.\ & Reversible adsorption & Adsorption & High eff.\ adsorption\ Available mol.\ & Insufficient coverage & Surface saturation & Precursor waste\tnote{$\dagger$} \ \midrule \mc{Processing} \ Temperature & Condensation & Adsorption & Desorption\tnote{$\star$}\ Pressure & Poor precursor carrier & Balanced & Lower interdiffusion\ Exposure time & Insufficient coverage & Complete coverage & Longer cycle\ \bottomrule \end{tabular}

\smallskip
\footnotesize \begin{tablenotes} \item[$\dagger$] Another thing. \item[$\star$] Something. \item[\phantom{$\dagger$}] Source: BBQ. \end{tablenotes} \end{threeparttable}

\end{document}

Mico
  • 506,678
  • Thank you, mind you explain so details... so the trick is to use a single-multicolumn in the first column? But then why the extra col sep ? – G. Bay Jan 11 '23 at 12:52
  • 1
    @G.Bay - For more information on the differences between the tabularx and tabular* approaches, please see this answer. The table above has 4 columns and hence 3 intercolumn whitespaces. The admittedly somewhat complicated-looking @{\extracolsep{\fill}} particle pertains to what's to be done with the intercolumn whitespaces -- "fill them up until the table's overall width reaches the target width" (here: \textwidth). – Mico Jan 11 '23 at 14:02