0

I want to fit a table in same column, but it seemed cannot fit, i do not want making the font size smaller than my other text.

\documentclass[12pt,oneside]{book}

\usepackage[showframe]{geometry}
\usepackage{amsmath}
\usepackage{ragged2e}
\usepackage{makecell, multirow, tabularx}
\renewcommand\theadfont{\small\bfseries} % for bold in table using \small
\renewcommand\theadgape{}
\usepackage[svgnames, table]{xcolor}
\usepackage{hhline, boldline}
\usepackage{seqsplit, caption} %for table spacing to second row
\usepackage{booktabs, ragged2e} % Use booktabs rules and get rid of vertical rules, ragged2e to ragged text
\usepackage{siunitx} %for table spacing to second row
\usepackage{threeparttable} %to add footnote below table
\usepackage{tabulary}
\usepackage{graphicx}

\begin{document}



\begin{table}[h!]
\centering
    \begin{tabularx}{\textwidth}{l>{\raggedright\arraybackslash}Xccc}
    \toprule
    & & \multicolumn{3}{c}{\textbf{Paired Differences}} \\
     \cmidrule{3-5}
     & & \small {\textbf{Mean (\%)}}
     & \thead{\small {\textbf{Std. Deviation}}\\ \textbf{(\%)}}& \thead{\small {\textbf{Std. Error}} \\ \textbf{Mean (\%)}} \\
\midrule
    \multicolumn{1}{l}{Pair 1} & \textit{Testing exAple dataset} (BB) - \textit{Testing example dataset} (AA) 
    & 44.76 & 14.92 & 4.72  \\
        \bottomrule
    \end{tabularx}
\caption{Table 1}
    \label{tab:Table 1}
\end{table}






\begin{table}[h!]
\centering
% \begin{center}
    %\begin{tabularx}{\textwidth}{@{}M*{6}{N}@{}}
    \begin{tabularx}{\textwidth}{>{\RaggedRight\arraybackslash}c X c c c c c }
        \toprule
    & & \multicolumn{2}{>{\centering\arraybackslash}p{8em}}{\textbf{95\% Confidence Interval of the Difference}}  &  \textbf{t}
      & \textbf {df} 
      & \textbf {Sig. (2-tailed)}  \\
     \cmidrule{3-4}  %\cmidrule(lr){3-4}
     & & \multicolumn{1}{c}{\textbf{Lower}} &  \multicolumn{1}{c}{\textbf{Upper}} & & &\\
\midrule
    Pair 1 & \textit{Testing example dataset} (BB) - \textit{Testing Example Dataset} (AA) & 34.09\% &  55.44\% & 9.49 & 9 & .000\\
    \bottomrule
    \end{tabularx}
\caption{Table 2}
    \label{tab:Table 2}
\end{table}
% \end{center}





\end{document} 

enter image description here

I split the table into 2 which not good looking enter image description here

aan
  • 2,663
  • 2
    Could you please add the code of your table as is? – CarLaTeX Nov 01 '19 at 11:12
  • 1
    What des "fit a table in a one row" from your question title mean? Did you mean "column instead of "row"? Also, you current document preamble will give you a one column document, so please clarify. – leandriis Nov 01 '19 at 11:21
  • you have the problem "how-to-put-elephant-to-lady-suitcase" ... – Zarko Nov 01 '19 at 11:37
  • @Zarko That is easy, You open the suitcase and ask the elephant in a polite way to step in. It it much more challenging to fit a table wide into a too narrow column. – Sveinung Nov 01 '19 at 12:46
  • @Sveinung, good point :-). Apparently so far I have not been enough polite ... BTW, what to do with tables in such cases is extensive described in given link to duplicate question (My table doesn't fit, ...). Also so far OP didn't provide code for her/his table. – Zarko Nov 01 '19 at 12:53
  • @Zarko. I had editted my questions. Initially, i was thinking anyway to squeese the table in a row. – aan Nov 02 '19 at 21:09
  • @CarLaTeX, I had edited my question and posted my codes – aan Nov 02 '19 at 21:09
  • @aan Thanks, voted to reopen – CarLaTeX Nov 02 '19 at 21:15
  • @ann, sorry, but now, after your editing of the question, it become unclear. Do you like to reproduce table showed in the first image? For this at least you should provide table code and explain, where is the problem, that solutions in given link not help you. If you not like to have this table, but two new different table, than please ask new question – Zarko Nov 02 '19 at 22:59

0 Answers0