# How to divide a table cell in two equal size columns?

I used the following code

\begin{table}[h]
\centering\setlength{\extrarowheight}{2pt}
\centering
\begin{tabular}{ |c|c|c|c|  }
\hline
\multicolumn{2}{|c|}{Binary Variables} & Index status & Output\\
\cline{1-2}
$a_i$  &   $b_j$  &     &  \\
\hline
1 & 1 & $i=j$ & $\uparrow \uparrow$ \\
\hline
1 & 0 & $i \neq j$ & $\uparrow -$ \\
\hline
0 & 1 & $i \neq j$ & $- \uparrow$ \\
\hline
0 & 0 & $i=j$ & $- -$ \\
\hline
\end{tabular}
\end{table}


to create the following table: I would like to have equal space in columns $a_i$ and $b_j$. How can I do this

You just have to use two p{..} columns ofthe relevant width. Here is a code:

\documentclass{article}
\usepackage{fourier}
\usepackage{array}
\usepackage{booktabs}
\usepackage{makecell}
\usepackage{calc, multirow}
\newlength{\cellwd}
\setlength{\cellwd}{\widthof{Binary Variables}}

\begin{document}

\begin{table}[h]
\centering\setlength{\extrarowheight}{2pt}
\centering
\begin{tabular}{ |*{2}{>{\centering}p{0.5\cellwd}|}c|c| }
\hline
\multicolumn{2}{|c|}{Binary Variables} & \multirowcell{2}{Index status} & \multirowcell{2}{Output}\\
\cline{1-2}
$a_i$ & $b_j$ & & \\
\hline
1 & 1 & $i=j$ & $\uparrow \uparrow$ \\
\hline
1 & 0 & $i ≠ j$ & $\uparrow -$ \\
\hline
0 & 1 & $i ≠ j$ & $- \uparrow$ \\
\hline
0 & 0 & $i=j$ & $- -$ \\
\hline
\end{tabular}
\end{table}

\end{document} 