How can I make these subtables horizontally instead of vertically positioned?
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[(margin=1in)]{geometry}
\usepackage{setspace}
\setstretch{1}
\begin{table}[ht!]
\begin{subtable}[t]{\textwidth}
\centering
\begin{tabular}{cc|cc|}
\cline{3-4}
& & \multicolumn{2}{c|}{B} \\ \cline{3-4}
& & \multicolumn{1}{c|}{Free Flow} & Regulation \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{*}{A}} & Free Flow & \multicolumn{1}{c|}{(3, 3)} & (2, 5) \\ \cline{2-4}
\multicolumn{1}{|c|}{} & Regulation & \multicolumn{1}{c|}{(5, 2)} & (1, 1) \\ \hline
\end{tabular}
\caption{Prisoner's dilemma}
\label{f1}
\end{subtable}
\hfill
\begin{subtable}[t]{\textwidth}
\centering
\begin{tabular}{cl|cc|}
\cline{3-4}
& & \multicolumn{2}{c|}{B} \\ \cline{3-4}
\multicolumn{1}{l}{} & & \multicolumn{1}{l|}{Free Flow} & \multicolumn{1}{l|}{Regulation} \\ \hline
\multicolumn{1}{|c|}{\multirow{2}{*}{A}} & Free Flow & \multicolumn{1}{c|}{(5, 5)} & (1, 3) \\ \cline{2-4}
\multicolumn{1}{|c|}{} & Regulation & \multicolumn{1}{c|}{(3, 1)} & (2, 2) \\ \hline
\end{tabular}
\caption{Stag Hunt}
\label{f2}
\end{subtable}
\caption{Policy Decision Matrix}
\label{F1}
\end{table}
Best Answer
The two most important changes you should make in order to achieve you typesetting objective are (a) eliminate the all-blank lines right before and right after
\hfill
, and (b) change the widths of thesubtable
environments from\textwidth
to, say,0.45\textwidth
.In the following example, I've also streamlined and simplified your code a bit. Some of the simplifications are made possible by changing
\begin{tabular}{cc|cc|}
to\begin{tabular}{|l|l|c|c|}
.