1

The submission guidelines for a conference depict following Word table:

Original template

So far, I got:

enter image description here

with following code:

\usepackage{tabularx,booktabs}
\usepackage{array}

    \begin{document}

    \begin{table}[ht]
    \renewcommand{\arraystretch}{1.25}
    \centering
    \label{tab:lme-mean}
    \begin{tabular}{|l|l|l|}
      \hline
      \multicolumn{3}{|c|}{\textbf{Table 1. A Sample Table}} \\
      \hline
                & Treatment 1 & Treatment 2 \\ 
      \hline
      Setting A & 125         & 95          \\ 
      \hline
      Setting B & 85          & 102         \\ 
      \hline
      Setting C & 98          & 85          \\ 
      \hline
    \end{tabular}
    \caption{Test table with caption} 
    \end{table}

\end{document}

Question: How can I add more top and bottom space (i.e. adjust the padding) for the first row in my table? Also, increasing the width of the table a bit would be a plus.

  • You could add a "strut": \vrule depth 2ex height 4ex width 0pt after \textbf{Table 1. A Sample Table} – user94293 Apr 5 '18 at 12:24
  • For the width of the columns, you could instead use p{.2\textwidth} instead of l for the column-type to get fixed-length, larger columns. – user94293 Apr 5 '18 at 12:26
0

like this?

enter image description here

with the package makecell and its macro \thead{...}:

\documentclass{article}
\usepackage{booktabs, makecell, tabularx,}
\renewcommand\theadfont{\bfseries}

\begin{document}
    \begin{table}[ht]
\renewcommand{\arraystretch}{1.2}
\centering
\label{tab:lme-mean}
\begin{tabular}{|l|l|l|}
    \hline
\multicolumn{3}{|c|}{\thead{Table 1. A Sample Table}} \\
    \hline
        & Treatment 1 & Treatment 2 \\
    \hline
Setting A & 125         & 95          \\
    \hline
Setting B & 85          & 102         \\
    \hline
Setting C & 98          & 85          \\
    \hline
\end{tabular}
\caption{Test table with caption}
    \end{table}
\end{document}
|improve this answer|||||

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.