0

Could I get some help to add a caption above each table, more horizontal distance between tables.Also if possible to get a caption just beneath each table. cheers

\begin{table}[!htb]
\tiny \setlength{\tabcolsep}{1.pt}
\begin{minipage}{.33\linewidth}
\centering

\caption{First Table}
\label{tab:first_table}

\begin{tabular}{c|c|c|c}
    \toprule
    \textbf{Term} & Default & Fully paid & \textbf{Ratio} \\ \hline
    $36$ months & $5881$ & $37473$ &  0.135 \\
    $60$ months & $2712$ & $6715$ &0.287 \\ \hline
    Pearson's & d.f & $pvalue$ \\
    $\chi^2 =1313$ & $1$ & $\approx 0$ \\
    \bottomrule
\end{tabular}\hfill
\end{minipage}
\begin{minipage}{.3\linewidth}
\centering

\caption{Second Table}
\label{tab:second_table}

\begin{tabular}{c|c|c|c}
    \toprule
    \textbf{Home Ow.} & Default & Fully paid & \textbf{Ratio} \\ \hline
    Mortg. & $3733$ & $20911$ &  0.15 \\
    Own & $710$ & $3456$ &  0.17 \\
    Rent& $4150$ & $19821$ &  0.173 \\ \hline
    Pearson's & d.f & $pvalue$ \\
    $\chi^2 =43.7$ & $2$ & $\approx 0$ \\
    \bottomrule
\end{tabular}
\end{minipage}\hfill
\begin{minipage}{.3\linewidth}
\centering
\caption{Third Table}
\label{tab:third_table}

\medskip

\begin{tabular}{c|c|c|c}
    \toprule
    \textbf{Inq.L.6mths} & Default & Fully paid & \textbf{Ratio} \\ \hline
    $0$ & $3609$ & $22371$ &  0.139 \\
    $1$ & $2565$ & $12322$ & 0.170 \\
    $2$& $1495$ & $6134$ &  0.195 \\ 
    $\geq 3$ & 924  & 3361 & 0.215 \\ \hline
    Pearson's & d.f & $pvalue$ \\
    $\chi^2 =277$ & $3$ & $\approx 0$ \\
    \bottomrule
\end{tabular}    
\end{minipage} 
\end{table}
1
  • please, extend your code snippet to complete small docement beginning with \documentclass{...} and ending with \end{document}
    – Zarko
    Nov 5, 2017 at 12:47

1 Answer 1

1

like this?

enter image description here

(red lines indicate page layout). since you didn't provide any information about your document, i design it. let me emphasize, that my solution (as any one) is depended from page layout and used packages, so i affraid that suggestion below will not work in your document (but works as it is :-) ):

\documentclass{article}
\usepackage{geometry}
\usepackage{booktabs, makecell, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage[skip=1ex,labelfont=bf]{caption}
\usepackage{siunitx}

%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

    \begin{document}
\begin{table}[htb]
\sisetup{group-minimum-digits=4}
\small
\setlength{\tabcolsep}{2 pt}
\begin{tabularx}{\linewidth}{@{}*{3}{C} @{}}
    \caption{First Table}
    \label{tab:first_table}
\begin{tabular}{ c S[table-format=4.0]
                   S[table-format=5.0]
                   S[table-format=1.3]
                }   
    \toprule
\textbf{Term}   & {Default} & {\makecell[b]{Fully\\ paid}}  & {\textbf{Ratio}}  \\
    \midrule
36 months       & 5881      & 37473                         &   0.135           \\
60 months       & 2712      & 6715                          &   0.287           \\
    \midrule
Pearson's       & {d.f}     & {\textit{pvalue}}             &                   \\
$\chi^2 =1313$  & {1}       & {$\approx 0$}                 &                   \\
    \bottomrule
\end{tabular}
    &
\caption{Second Table}
    \label{tab:second_table}
\begin{tabular}{ c S[table-format=4.0]
                   S[table-format=5.0]
                   S[table-format=1.3]
                }
    \toprule
\textbf{Term}   & {Default} & {\makecell[b]{Fully\\ paid}}  & {\textbf{Ratio}}  \\
           \midrule
Mortg.          & 3733      & 20911                         &  0.15             \\
Own             & 710       & 3456                          &  0.17             \\
Rent            & 4150      & 19821                         &  0.173            \\
    \midrule
Pearson's       & {d.f}     & {\textit{pvalue}}             &                   \\
$\chi^2 =43.7$  & {2}       & {$\approx 0$}                 &                   \\
    \bottomrule
\end{tabular}
    &
\caption{Third Table}
    \label{tab:third_table}
\begin{tabular}{ c S[table-format=4.0]
                   S[table-format=5.0]
                   S[table-format=1.3]
                }
    \toprule
\bfseries\makecell[b]{Inq. L.\\6 months}
                & {Default} & {\makecell[b]{Fully\\ paid}}  & {\textbf{Ratio}}  \\                        \midrule
$0$             & 3609      & 22371                         &  0.139            \\
$1$             & 2565      & 12322                         & 0.170             \\
$2$             & 1495      & 6134                          &  0.195            \\
$\geq 3$        & 924       & 3361                          & 0.215             \\
    \midrule
Pearson's       & {d.f}     & {\textit{pvalue}}             &                   \\
$\chi^2 =277$   & {3}       & {$\approx 0$}                 &                   \\
    \bottomrule
\end{tabular}
\end{tabularx}
\end{table}
\end{document}

You must log in to answer this question.

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