1

I want to make a table like this:

enter image description here

And i tried it with following code:

\begin{table}[h]
\centering
\begin{tabular}{|lc|l|lc|}
\cline{1-2} \cline{4-5}
\multicolumn{2}{|c|}{(1)}                        & \multirow{4}{*}{} & \multicolumn{2}{c|}{(2)}              \\ \cline{1-2} \cline{4-5} 
\multicolumn{1}{|l|}{\((1 - p)^{160}\)} & $\Box$ &                   & \multicolumn{1}{l|}{\(1 - \bigg[
    \binom{160}{0} \cdot p^0 \cdot (1-p)^{160} + 
    \binom{160}{1} \cdot p^1 \cdot (1-p)^{159}
    \bigg]\)} & $\Box$ \\ \cline{1-2} \cline{4-5} 
\multicolumn{1}{|l|}{\(p^{160}\)}       & $\Box$ &                   & \multicolumn{1}{l|}{\(\binom{160}{2} \cdot p^2 \cdot (1-p)^{158}\)} & $\Box$ \\ \cline{1-2} \cline{4-5} 
\multicolumn{1}{|l|}{\((1 - p)^{160}\)} & $\Box$ &                   & \multicolumn{1}{l|}{\(\binom{160}{0} \cdot p^0 \cdot (1-p)^{160} + 
    \binom{160}{1} \cdot p^1 \cdot (1-p)^{159}\)} & $\Box$ \\ \cline{1-2} \cline{4-5} 
\end{tabular}
\end{table}

and it looks like this:

enter image description here

1
  • 2
    Please note that we need a compileable minimum WORKING example (MWE) and the above is not compileable. In the meantime, check out the tabularx package and its \tabularxlineheight setting. This may be helpful. Commented Nov 23 at 11:47

1 Answer 1

0

Here's a solution that employs typographic struts to assure equal heights for rows 2 thru 4. It also uses an array environment instead of a tabular environment in order to eliminate the multitude of \(, \) and $ directives. It further does away with the pointless \multirow{4}{*}{} directive. Finally, it changes the column specification from {|lc|l|lc|} to {|l|c|l|l|c|} in order to do away with all \multicolumn{1}{|l|} wrappers.

enter image description here

\documentclass{article} % or some other suitable document class
\usepackage{array}
\usepackage{amsmath}    % for '\binom' macro
\usepackage{amssymb}    % for '\Box' macro
% Define a typographic strut:
\newcommand\tallstrut{$\vphantom{\Big[}$} % for rows 2-4

\begin{document}

\begin{table}[h]
\[
\begin{array}{|l|c|l|l|c|}
\cline{1-2} \cline{4-5}
\multicolumn{2}{|c|}{(1)} & & 
\multicolumn{2}{ c|}{(2)}\\ 
\cline{1-2} \cline{4-5} 
(1 - p)^{160} & \Box\tallstrut & & 
1 - \bigl[ \binom{160}{0} \cdot p^0 \cdot (1-p)^{160} + 
           \binom{160}{1} \cdot p^1 \cdot (1-p)^{159}
    \bigr] & \Box \\ 
\cline{1-2} \cline{4-5} 
p^{160}       & \Box\tallstrut & & 
\binom{160}{2} \cdot p^2 \cdot (1-p)^{158} & \Box \\ 
\cline{1-2} \cline{4-5} 
(1 - p)^{160} & \Box\tallstrut & & 
\binom{160}{0} \cdot p^0 \cdot (1-p)^{160} + 
\binom{160}{1} \cdot p^1 \cdot (1-p)^{159} & \Box \\ 
\cline{1-2} \cline{4-5} 
\end{array}
\]
\end{table}
\end{document}
1
  • Incidentally, if you want rows 2 thru 4 to be even taller, you could change \newcommand\tallstrut{$\vphantom{\Big[}$} to \newcommand\tallstrut{$\vphantom{\bigg[}$}.
    – Mico
    Commented Nov 23 at 14:35

You must log in to answer this question.

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