1

I want to add some space between column labels States, Inputs and Outputs. Now they are very close so it doesn't look good. What can I do to add some space?

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{float}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage[colorlinks,citecolor=blue,linkcolor=blue,bookmarks=false,hypertexnames=true]{hyperref} 
\usepackage{algorithm}
\usepackage{graphicx}
\usepackage{rotating,booktabs,multirow}

\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\setlength{\tabcolsep}{0.7pt}


\begin{table*}[t]
\centering
\begin{tabular}{c c c c c c c c}
\midrule
\multicolumn{3}{c}{} & \multicolumn{2}{c}{Freezed } &\multicolumn{2}{c}{Solid SF} \\ 
\cmidrule(r){4-7}
 States & Inputs & Outputs & Length & Time & Length & Time \\ 
\cmidrule(r){1-4}\cmidrule(l){4-7}
\multirow{1}{*}{4096}& 2 &  2 & 21.47 & 63327.2 & 21.62 & 52520.84 \\
\midrule
\bottomrule
\end{tabular}

\caption{Averages of experiments}
\label{tab:t3}
\end{table*}
\end{document}
  • Please help us help you and add a minimal working example (MWE) that illustrates your problem instead of just a code snippet. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – albert Aug 5 '18 at 16:24
  • I think, I added a working one. – Goju Aug 5 '18 at 16:31
2

Do not modify \tabcolsep

 %\setlength{\tabcolsep}{0.7pt}

it makes no sense with such a small space.

  • Actually, that stands for the previous table. – Goju Aug 5 '18 at 16:41
1

mostly off-topic (since main problem is solved by Herbert answer) however i see in table's code more issues. i would to alter it as follows:

\documentclass[12pt]{article}
%\usepackage[utf8]{inputenc} % now id default
\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\usepackage{float}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{algorithm}
\usepackage{graphicx}

\usepackage{booktabs, multirow, rotating}
\usepackage[colorlinks,citecolor=blue,linkcolor=blue,bookmarks=false,hypertexnames=true]{hyperref} % had to be last in preamble

\begin{document}
\begin{table*}[t]
    \centering
\begin{tabular}{c c c c c c c c}
    \toprule
\multicolumn{3}{c}{} & \multicolumn{2}{c}{Freezed} & \multicolumn{2}{c}{Solid SF} \\
    \cmidrule(r){4-5}\cmidrule(l){6-7}
 States & Inputs & Outputs & Length & Time & Length & Time \\
    \midrule
4096    & 2 & 2 & 21.47 & 63327.2 & 21.62 & 52520.84 \\
\bottomrule
\end{tabular}

\caption{Averages of experiments}
\label{tab:t3}
\end{table*}
\end{document}

in case, that your table will have more (many) rows, you should consider to use the S column type which enable align numbers at decimal points:

 ...
\usepackage {siunitx}
...

\begin{document}
\begin{table*}[t]
    \centering
\begin{tabular}{c cc S[table-format=2.2]
                     S[table-format=5.1]
                     S[table-format=2.2]
                     S[table-format=5.2]
                }
    \toprule
\multicolumn{3}{c}{} & \multicolumn{2}{c}{Freezed} & \multicolumn{2}{c}{Solid SF} \\
    \cmidrule(r){4-5}\cmidrule(l){6-7} % changed
 States & Inputs & Outputs & {Length} & {Time} & {Length} & {Time}      \\
    \midrule
4096    & 2      & 2       & 21.47   & 63327.2 & 21.62    & 52520.84    \\
\bottomrule
\end{tabular}

enter image description here

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.