我的文本在一栏中没有结束

我的文本在一栏中没有结束
\begin{table}[h!]
    \centering
    \begin{tabular}{|l|>{\centering\arraybackslash}m{3.7cm}|l|l|l|l|} 
        \hline
        Sr. No &  &       & &   \\ 
        \cline{1-2}\cline{3-3}\cline{4-6}
            & \multirow{4}{*}{Australian Open \newline (Statistical Data from 2016-2019)} &      &   &        &       \\ 
        \cline{1-1}\cline{3-6}
        2      &                                                                     &      & M  &         &         \\ 
        \cline{1-1}\cline{3-6}
        3      &                                                                     &      &  &         &        \\ 
        \cline{1-1}\cline{3-6}
        4      &                                                                     &     &  &         &         \\ 
        \hline
        5      & \multirow{4}{*}{Malaysian Open  (Statistical Data from 2016-2019)}  &      &    &         &         \\ 
        \cline{1-1}\cline{3-6}
        6      &                                                                     &       &  &         &       \\ 
        \cline{1-1}\cline{3-6}
        7      &                                                                     &      &  &         &        \\ 
        \cline{1-1}\cline{3-6}
        8      &                                                                     &       &  &          &        \\ 
        \hline

    \end{tabular}
\end{table}

答案1

而不是{*},使用{3.7cm}multirow

\documentclass{article}
\usepackage{multirow,array}

\begin{document}

\begin{table}[h!]
\begin{tabular}{|*6{l|}}
\hline
Sr. No &                                                                          & &   & & \\ \hline
1      & \multirow{4}{3.7cm}{Australian Open\\ (Statistical Data from 2016-2019)} & &   & & \\ \cline{1-1} \cline{3-6}
2      &                                                                          & & M & & \\ \cline{1-1} \cline{3-6}
3      &                                                                          & &   & & \\ \cline{1-1} \cline{3-6}
4      &                                                                          & &   & & \\ \hline
5      & \multirow{4}{3.7cm}{Malaysian Open\\ (Statistical Data from 2016-2019)}  & &   & & \\ \cline{1-1} \cline{3-6}
6      &                                                                          & &   & & \\ \cline{1-1} \cline{3-6}
7      &                                                                          & &   & & \\ \cline{1-1} \cline{3-6}
8      &                                                                          & &   & & \\ \hline
\end{tabular}
\end{table}

\end{document}

PS:此外,正如@leandriis 所建议的,您可以3.7cm通过修改标题来节省重复输入的时间\begin{tabular}{|l|p{3.7cm}|*4{l|}},而不必\multirow{4}{3.7cm}{...}每次都输入内容,只需将原始内容替换*=这样的内容即可\multirow{4}{=}{...}

答案2

大部分都是题外话,但也许你喜欢有点不同的表格设计:

在此处输入图片描述

\documentclass{article}
\usepackage{array, booktabs, makecell, multirow}
\usepackage{siunitx}

\begin{document}
    \begin{table}[ht]
\begin{tabular}{@{} S[table-format=2.0]
                >{\raggedright}p{48mm}
                *4{p{1em}}
                @{}}
    \toprule
{\makecell{Sr.\\ No}}    
    &   \makecell{Statistical Data\\ from 2016-2019}
                            & a & b & c & d \\
    \midrule
1   &    Australian Open    & ? &   &   &   \\ 
2   &                       &   & M &   &   \\ 
3   &                       &   &   & ? &   \\
4   &                       &   &   &   & ? \\
    \midrule
5   &    Malaysian Open     &   &   &   & \\
6   &                       &   &   &   & \\
7   &                       &   &   &   & \\
8   &                       &   &   &   & \\
    \bottomrule
\end{tabular}
    \end{table}
or
    \begin{table}[ht]
\begin{tabular}{@{} S[table-format=2.0]
                >{\raggedright}p{32mm}
                *4{p{1em}}
                @{}}
    \toprule
{\makecell{Sr.\\ No}}
    &   Statistical Data    & a & b & c & d \\
    \midrule
1   &   \multirow [t]{4}{=}{Australian Open
                           from 2016-2019}     
                            & ? &   &   &   \\
2   &                       &   & M &   &   \\
3   &                       &   &   & ? &   \\
4   &                       &   &   &   & ? \\
    \midrule
5   &   \multirow [t]{4}{=}{Malaysian Open
                           from 2016-2019}
                            &   &   &   &   \\
6   &                       &   &   &   &   \\
7   &                       &   &   &   &   \\
8   &                       &   &   &   &   \\
    \bottomrule
\end{tabular}
    \end{table}
\end{document}

答案3

使用漂亮的表格和修改后的标题 - 可以减少多行宽度,如@AboAmmar 所建议的那样

在此处输入图片描述

    \documentclass{article}
    \usepackage{caption,tabularx,booktabs}
    \usepackage[table]{xcolor}
    \usepackage{showframe}
    \usepackage{multirow}
    \begin{document}
    \begin{table}[h!]
    \centering
        \begin{tabularx}{\textwidth}{l||X||llll}\rowcolor{green!20}                                         
    Sr. No & \multicolumn{5}{c}{Statistical Data from 2016-2019}\\\rowcolor{blue!20}
         &   &      &   &        &       \\\rowcolor{blue!20}
        2&  &      & M  &         &       \\\rowcolor{blue!20}
        3&    &      &  &         &        \\\rowcolor{blue!20}
        4& \multirow{-4}{*}{Australian Open } &&&&\\\rowcolor{blue!20}        
        5&                  &      &    & & \\\rowcolor{red!20}         
        6&               &       &  &  &    \\\rowcolor{red!20}
        7&      &      &  &         &        \\\rowcolor{red!20}
        8&\multirow{-4}{*}{Malaysian Open}&&&&\\\rowcolor{red!20}       
    \end{tabularx}
\end{table}
\end{document}

相关内容