如何将单词分成表格中的两行?

如何将单词分成表格中的两行?

我对乳胶和表格制作还很陌生。我想将内容分成两行,以便在表格中留出更多空间。

从一行开始:

Sig. (2-tailed)

分成两排:

Sig.
(2-tailed)

在此处输入图片描述

\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{tabulary}
\usepackage{graphicx}

\begin{document}


\begin{table}[h!]
\centering
    %  \begin{tabularx}{\textwidth}{@{}M*{6}{N}@{}}
\begin{tabularx}{\textwidth}{>{\RaggedRight\arraybackslash}cXccccc}
        \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{Abcde qpweo example dataset} (AA) - \textit{Abcde qpweo example dataset} (BB) & 52.44\% &  34.42\%  & 1.55 & 4 & 0.001\\
        \bottomrule
    \end{tabularx}
\end{table}

\end{document}

答案1

\multirow在和的帮助下\makecell

在此处输入图片描述

\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{tabulary}
\usepackage{graphicx}

\begin{document}


\begin{table}[h!]
\centering
    %  \begin{tabularx}{\textwidth}{@{}M*{6}{N}@{}}
\begin{tabularx}{\textwidth}{>{\RaggedRight\arraybackslash}cXccccc}
        \toprule
    & & \multicolumn{2}{>{\centering\arraybackslash}p{8em}}{\textbf{95\% Confidence Interval of the Difference}}  &  \multirow{4.5}{*}{\textbf{t}}
      & \multirow{4.5}{*}{\textbf {df}} 
      & \multirow{4.5}{*}{\makecell{\textbf{Sig.}\\ \textbf{(2-tailed)}}}  \\
     \cmidrule{3-4}  %\cmidrule(lr){3-4}
     & & \multicolumn{1}{c}{\textbf{Lower}} &  \multicolumn{1}{c}{\textbf{Upper}} & & &\\
\midrule
     Pair 1 & \textit{Abcde qpweo example dataset} (AA) - \textit{Abcde qpweo example dataset} (BB) & 52.44\% &  34.42\%  & 1.55 & 4 & 0.001\\
        \bottomrule
    \end{tabularx}
\end{table}

\end{document}

答案2

@newlatex——你需要做的就是::


    \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{tabulary}
    \usepackage{graphicx}

    \begin{document}


    \begin{table}[h!]
    \centering
        %  \begin{tabularx}{\textwidth}{@{}M*{6}{N}@{}}
    \begin{tabularx}{\textwidth}{>{\RaggedRight\arraybackslash}cXccccc}
            \toprule
        & & \multicolumn{2}{>{\centering\arraybackslash}p{8em}}{\textbf{95\% Confidence Interval of the Difference}}  &  \textbf{t} & \textbf {df} & \textbf {Sig. }  \\

         \cmidrule{3-4}  %\cmidrule(lr){3-4}
         & & \multicolumn{1}{c}{\textbf{Lower}} &  \multicolumn{1}{c}{\textbf{Upper}} & \textbf{t}&\textbf {df} &\textbf{(2-tailed)}\\
    \midrule
         Pair 1 & \textit{Abcde qpweo example dataset} (AA) - \textit{Abcde qpweo example dataset} (BB) & 52.44\% &  34.42\%  & 1.55 & 4 & 0.001\\
            \bottomrule
        \end{tabularx}
    \end{table}

    \end{document}

``````````````````````````````````````````

答案3

我怀疑这是新的问题如何将表格放在一行中。以上述问题中第一张图片中所示的表格为起点,可以写成如下形式:

\documentclass[12pt,oneside]{book}
\usepackage[showframe]{geometry}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, multirow, tabularx, tabulary}
\renewcommand\theadfont{\small\bfseries} % for bold in table using \small
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight}X}
\usepackage{threeparttable} %to add footnote below table
 \usepackage[svgnames, table]{xcolor}
\usepackage[skip=1ex]{caption} %for table spacing to second row
\usepackage{siunitx} %for table spacing to second row

    \begin{document}
        \begin{table}[ht]
\sisetup{round-mode = places,
         round-precision=2,
         detect-weight
         }
\setlength\tabcolsep{3pt}
    \begin{threeparttable}
\caption{Bootstrap for paired Samples Test}
\label{tab:blabla}
        \begin{tabularx}{\linewidth}
                {@{} l L *{3}{S[table-format=2.2,table-space-text-post={\,\%}]}
                              S[table-format=1.3]
                         *{2}{S[table-format=2.2,table-space-text-post={\,\%}]}
                 @{}}
        \toprule
        &   &               &               &               &       & \multicolumn{2}{c}{\thead{\SI{95}{\%} Confidence\\ Interval}}                                    \\
        \cmidrule{7-8}
        &   & {Mean}        & {Bias}        & {\thead{SE\tnote{a}}} & {\thead{STT\tnote{b}}}
                                                                    & {\thead{Lower}}
                                                                        & {\thead{Upper}}   \\
        \toprule
Pair 1  & Testing example dataset (BB) - Testing Example Dataset (AA)
            & 12.34567\%    & 12.34567\%    & 12.34567\%    & 1.234 & 12.34567\%    & 12.34567\%    \cr
        \bottomrule
    \end{tabularx}
\begin{tablenotes}[para, flushleft]
\item[a]    SE: Standard Error
\item[b]    STT: Signal, Two Tailed
\end{tablenotes}
    \end{threeparttable}
        \end{table}
\end{document}

在此处输入图片描述

以类似的方式,您可以根据以下问题重新设计您的表格:

\documentclass[12pt,oneside]{book}
\usepackage[showframe]{geometry}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, multirow, tabularx, tabulary}
\renewcommand\theadfont{\small\bfseries} % for bold in table using \small
\renewcommand\theadgape{}
\newcolumntype{L}{>{\RaggedRight}X}
\usepackage{threeparttable} %to add footnote below table
 \usepackage[svgnames, table]{xcolor}
\usepackage[skip=1ex]{caption} %for table spacing to second row
\usepackage{siunitx} %for table spacing to second row

    \begin{document}
        \begin{table}[ht]
\sisetup{round-mode = places,
         round-precision=2,
         detect-weight
         }
    \begin{threeparttable}
\caption{Bootstrap for paired Samples Test}
\label{tab:blabla}
        \begin{tabularx}{\linewidth}
                {@{} l L *{2}{S[table-format=2.2,table-space-text-post={\,\%}]}
                              S[table-format=1.2]
                              S[table-format=1.0]
                              S[table-format=1.3]
                  @{}}
        \toprule
        &   & \multicolumn{2}{c}{\thead{\SI{95}{\%} CID\tnote{a}}} 
                                    &               &               &                           \\
        \cmidrule{3-4}
        &   & {\thead{Lower}}    
                & {\thead{Upper}}   & {\thead{t}}   & {\thead{df}}  & {\thead{STT\tnote{b}}}   \\
        \toprule
Pair 1  & Testing example dataset (BB) - Testing Example Dataset (AA)
            & 12.34567\%    
                & 12.34567\%        & 1.23          & 4             & 0.001                     \\
        \bottomrule
    \end{tabularx}
\begin{tablenotes}[para, flushleft]
\item[a]    CID: Confidence Interval of the Difference
\item[b]    STT: Signal, Two Tailed
\end{tablenotes}
    \end{threeparttable}
        \end{table}
\end{document}

在此处输入图片描述

相关内容