1

I generate a table with the following code:

\documentclass{article}
\usepackage{multirow}
\usepackage{array}
\begin{document}
\usepackage{multirow}
\usepackage{array}
\begin{table}[H]
\centering
 \caption{Comparison of market prices, Black-Scholes prices and calibrated 
 Kou prices}
\begin{tabular}{>{\bfseries}c*{6}{c}}\toprule
   \multirow{3.5}{*}{\bfseries Exercise Date} & &  &  \textbf{Strike Price} 
& \textbf{}\\
    \cmidrule(r{4pt}){2-6}
& & \multicolumn{3}{c}{\bfseries 4800} &      \\ 
 \cmidrule(r{4pt}){2-6}
 & \textbf{Market Price} & \textbf{Black-Scholes Price}& \textbf{Kou Price} & \textbf{BS error} & \textbf{Kou error}\\
\midrule
18/11/2017 & x & x  & x & x & x  \\
6/12/2017  & x & x  & x & x & x \\ 
1/05/2018  & x & x  & x & x & x  \\
12/06/2018  & x & x  & x & x & x  \\ \bottomrule
  \end{tabular}
  \begin{tabular}{>{\bfseries}c*{6}{c}}
 & & \multicolumn{3}{c}{\bfseries 5600} &      \\ 
 \cmidrule(r{4pt}){2-6}
 & \textbf{Market Price} & \textbf{Black-Scholes Price}& \textbf{Kou Price} & \textbf{BS error} & \textbf{Kou error}\\
\midrule
  & x & x  & x & x & x\\
  & x & x  & x & x & x\\ 
  & x & x  & x & x & x\\
  & x & x  & x & x & x\\ \bottomrule
 \end{tabular}
\begin{tabular}{>{\bfseries}c*{6}{c}}
& & \multicolumn{3}{c}{\bfseries 5900} &      \\ 
 \cmidrule(r{4pt}){2-6}
 & \textbf{Market Price} & \textbf{Black-Scholes Price}& \textbf{Kou Price} & \textbf{BS error} & \textbf{Kou error}\\
\midrule
  & x & x  & x & x & x\\
  & x & x  & x & x & x\\ 
  & x & x  & x & x & x\\
  & x & x  & x & x & x \\ \bottomrule
  \end{tabular}
 \end{table}
 \end{document}

The outputted table is: fout Now, the table should look like:

enter image description here So the second and third tabular need to be aligned with the top tabular. Also the tabular headings need to be centered, as well as the word "Exercise Date" (see the image above).

How can I get this done? (maybe with setting a fixed column widt?)

2
  • Welcome to TeX.SX! Please make your code compilable for us, see minimal working example MWE starting with \documentclass and ending with \end{document}. Maybe helpful
    – Bobyandbob
    Commented Aug 20, 2017 at 16:20
  • why are you setting this as multiple tabular? If you want the columns to align, just use one tabular Commented Aug 20, 2017 at 16:29

1 Answer 1

2

To keep columns aligned, it is better to merge the three tabulars into one. This is simply achieved via commenting out four lines, \end{tabular}\begin{tabular} .. \end{tabular}\begin{tabular}, as shown below. You will face only one problem, which is how to trim the \bottomrules of the 2nd and 3rd tabulars, this can be solved by using \cmidrule[\heavyrulewidth]{2-6} instead of a \bottomrule.

\documentclass[10pt,a4paper]{article}
\usepackage{multirow,booktabs}
\usepackage{array}
\usepackage[margin=.8in]{geometry}
\begin{document}

\begin{table}
\centering
 \caption{Comparison of market prices, Black-Scholes prices and calibrated 
 Kou prices}
\begin{tabular}{>{\bfseries}c*{6}{c}}\toprule
   \multirow{3.5}{*}{\bfseries Exercise Date} & &  &  \textbf{Strike Price} 
& \textbf{}\\
    \cmidrule(r{4pt}){2-6}
& & \multicolumn{3}{c}{\bfseries 4800} &      \\ 
 \cmidrule(r{4pt}){2-6}
 & \textbf{Market Price} & \textbf{Black-Scholes Price}& \textbf{Kou Price} & \textbf{BS error} & \textbf{Kou error}\\
\midrule
18/11/2017 & x & x  & x & x & x  \\
6/12/2017  & x & x  & x & x & x \\ 
1/05/2018  & x & x  & x & x & x  \\
12/06/2018  & x & x  & x & x & x  \\ \bottomrule
  %\end{tabular}
  %\begin{tabular}{>{\bfseries}c*{6}{c}}
 & & \multicolumn{3}{c}{\bfseries 5600} &      \\ 
 \cmidrule(rl){2-6}
 & \textbf{Market Price} & \textbf{Black-Scholes Price}& \textbf{Kou Price} & \textbf{BS error} & \textbf{Kou error}\\
\cmidrule{2-6}
  & x & x  & x & x & x\\
  & x & x  & x & x & x\\ 
  & x & x  & x & x & x\\
  & x & x  & x & x & x\\ \cmidrule[\heavyrulewidth]{2-6}
 %\end{tabular}
%\begin{tabular}{>{\bfseries}c*{6}{c}}
& & \multicolumn{3}{c}{\bfseries 5900} &      \\ 
 \cmidrule(rl){2-6}
 & \textbf{Market Price} & \textbf{Black-Scholes Price}& \textbf{Kou Price} & \textbf{BS error} & \textbf{Kou error}\\
\cmidrule{2-6}
  & x & x  & x & x & x\\
  & x & x  & x & x & x\\ 
  & x & x  & x & x & x\\
  & x & x  & x & x & x \\ \cmidrule[\heavyrulewidth]{2-6}
  \end{tabular}
 \end{table}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .