6

I am trying to make a LaTeX table. I have prepared the following code.

\begin{table}[htbp]
\caption{Combination Nomenclature, (Average Fill Factor)}
\resizebox{1.0\textwidth}{!}{
\begin{tabular}{|c||c|c|c|c|}
\hline
\textbf{Combination} &\multicolumn{4}{l|}{\textbf{Included Optional Steps}}\\
\cline{2-5}
&\textbf{1}&\textbf{2}&\textbf{3}&\textbf{4}\\
\hline\hline
\textbf{1}& X & & & \\
\hline
\textbf{2}& X & X & & \\
\hline
\textbf{3}& X & X & X & \\ 
\hline
\textbf{4}& X & X &  &X \\ 
\hline
\textbf{5}& X &  & X & \\ 
\hline
\textbf{6}& X &  & X & X\\ 
\hline
\textbf{7}& X &  & & X\\
\hline
\textbf{8}&  & X & &\\
\hline
\textbf{9}&  & X &  X &\\
\hline
\textbf{10}&  & X &  X & X\\
\hline
\textbf{11}&  & X & & X\\
\hline
\textbf{12}&  &  & X & \\
\hline
\textbf{13}&  &  & X & X \\
\hline
\textbf{14}&  &  &  & X \\
\hline
\hline
\textbf{15}& \multicolumn{1}{l}{Nano Particles Deposited, Not Sintered} &  &  & \\
\hline
\textbf{16}& \multicolumn{1}{l}{Only Grinded Wafer 1, No Particles Deposited, Not Sintered} &  &  & \\
\hline
\textbf{17}& \multicolumn{1}{l}{Only Grinded Wafer 2, No Particles Deposited, Not Sintered}  &  &  &\\
\hline
\end{tabular}}
\label{table:AverageFillFactor}
\end{table}

As you can see, the combinations 15-17 should be indipendent of the rows above and optional steps 1-4 should have equal width. The problem is that I am not sure, how to separate them.

Moriambar
  • 11,466
Levon
  • 63
  • 3
    You should avoid vertical lines. Please have a look at this pdf http://www.ece.cmu.edu/~pueschel/teaching/guides/guide-tables.pdf and this question: http://tex.stackexchange.com/questions/33758/professional-looking-tables-with-alternating-row-colors – Marco Daniel Dec 18 '11 at 11:34

2 Answers2

7

One way would be to fix the width of the columns as in the first example:

enter image description here

It would be even better to eliminate the vertical lines as in the second example:

enter image description here

\documentclass{article}
\usepackage{graphicx}

\begin{document}
\begin{table}[htbp]
\caption{Combination Nomenclature, (Average Fill Factor)}
\resizebox{1.0\textwidth}{!}{
\begin{tabular}{|c||p{1.0em}|p{1.0em}|p{1.0em}|p{1.0em} l|}
\hline
\textbf{Combination} &\multicolumn{5}{l|}{\textbf{Included Optional Steps}}\\
\cline{2-6}
&\textbf{1}&\textbf{2}&\textbf{3}&\textbf{4}&\\
\hline\hline
\textbf{1}& X & & & &\\
\hline
\textbf{13}&  &  & X & X &\\
\hline
\textbf{14}&  &  &  & X &\\
\hline
\hline
\textbf{15}& \multicolumn{4}{l}{Nano Particles Deposited, Not Sintered}&\\
\hline
\textbf{16}& \multicolumn{4}{l}{Only Grinded Wafer 1, No Particles Deposited, Not Sintered}&\\
\hline
\textbf{17}& \multicolumn{4}{l}{Only Grinded Wafer 2, No Particles Deposited, Not Sintered}&\\
\hline
\end{tabular}}
\label{table:AverageFillFactor}
\end{table}
%
\begin{table}[htbp]
\caption{Combination Nomenclature, (Average Fill Factor)}
\resizebox{1.0\textwidth}{!}{
\begin{tabular}{c p{1.0em} p{1.0em} p{1.0em} p{1.0em} l }
\hline
\textbf{Combination} &\multicolumn{5}{l}{\textbf{Included Optional Steps}}\\
\cline{2-6}
&\textbf{1}&\textbf{2}&\textbf{3}&\textbf{4}&\\
\hline\hline
\textbf{1}& X & & & &\\
\hline
\textbf{13}&  &  & X & X &\\
\hline
\textbf{14}&  &  &  & X &\\
\hline
\hline
\textbf{15}& \multicolumn{4}{l}{Nano Particles Deposited, Not Sintered}&\\
\hline
\textbf{16}& \multicolumn{4}{l}{Only Grinded Wafer 1, No Particles Deposited, Not Sintered}&\\
\hline
\textbf{17}& \multicolumn{4}{l}{Only Grinded Wafer 2, No Particles Deposited, Not Sintered}&\\
\hline
\end{tabular}}
\label{table:AverageFillFactor}
\end{table}
\end{document}
Peter Grill
  • 223,288
3
\documentclass{article}
\usepackage{graphicx,array}    
\begin{document}

\begin{table}[!htb]
\def\arraystretch{1.3}% more vertical space
\caption{Combination Nomenclature, (Average Fill Factor)}\label{table:AverageFillFactor}
\medskip
\resizebox{1.0\textwidth}{!}{%
\begin{tabular}{|>{\bfseries}c||p{1.0em}|p{1.0em}|p{1.0em}|p{1.0em} l|}      \hline
\textbf{Combination} &\multicolumn{5}{l|}{\textbf{Included Optional Steps}}\\\cline{2-6}
   & \textbf{1}&\textbf{2}&\textbf{3}&\textbf{4}&\\\hline\hline
 1 & X & & & &    \\\hline
13 &  &  & X & X &\\\hline
14 &  &  &  & X & \\\hline\hline
15 & \multicolumn{4}{l}{Nano Particles Deposited, Not Sintered}&\\\hline
16 & \multicolumn{4}{l}{Only Grinded Wafer 1, No Particles Deposited, Not Sintered}&\\\hline
17 & \multicolumn{4}{l}{Only Grinded Wafer 2, No Particles Deposited, Not Sintered}&\\\hline
\end{tabular}}
\end{table}

\end{document}

enter image description here