修复多行和多列

修复多行和多列

我如何添加(修复)最后两行?我需要为每一行添加一行:

在此处输入图片描述

\documentclass{article}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{booktabs}

\begin{document}

\begin{table}[htbp]

    \centering
    \small

        \begin{tabular}{@{}lll@{}}

            \toprule
            \textbf{Dataset}    &\textbf{Mod }&\textbf{Best blblbl } \\ \midrule
            \multirow{5}{*}{100K}    & Baseline proed & $n=50$, $\gamma =0.003862$, $\lambda=0.010161$  \\\cmidrule{2-3}
            & Algorithm 1 &   $n=39$,$\gamma =0.001229$, $\lambda=0.034972$, $L=39$ \\ \cmidrule{2-3}
            & Algorithm 2 &   $n=50$, $\gamma =0.009$, $\lambda=0.01$, $L=100$  \\ \cmidrule{2-3}
            & Algorithm 3&   $n=50$, $\gamma_{pu} =0.004815$, $\gamma_{qi} =0.006103$, $\lambda_{pu}=0.09$, $\lambda_{qi}=0.09$  \\ \cmidrule{2-3}
            & Algorithm 4 & $n=50$, $\gamma_{pu} =0.004815$, $\gamma_{qi} =0.006103$, $\gamma_{bu} =0.006103$, $\gamma_{bi} =0.006103$, $\lambda_{pu}=0.09$, $\lambda_{qi}=0.09$, $\lambda_{bu}=0.09$, $\lambda_{bi}=0.09$   \\  \cmidrule{2-3}
            & Algorithm 5 & $n=50$, $\gamma_{pu} =0.004815$, $\gamma_{qi} =0.006103$, $\gamma_{bu} =0.006103$, $\gamma_{bi} =0.006103$, $\lambda_{pu}=0.09$, $\lambda_{qi}=0.09$, $\lambda_{bu}=0.09$, $\lambda_{bi}=0.09$   \\  \midrule








            %\multirow{2}{*}{1M}  & BSVD Bias & $k=50$, $\gamma =0.01$, $\lambda=0.1$\\\cmidrule{2-3}
            %                & Proposed Method   &   X\\
            \bottomrule
        \end{tabular}

    \caption{.} 


\end{table}

\end{document}

答案1

使用tabularx你可以在第三列中换行:

\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs, multirow, tabularx}

\begin{document}
    \begin{table}[htbp]
    \centering
    \small
\begin{tabularx}{\linewidth}{@{} llX @{} }
    \toprule
\textbf{Dataset}    & \textbf{Mod}  & \textbf{Best blblbl}  \\
    \midrule
\multirow{11}{*}{100K}    
    & Baseline proed    & $n=50$, $\gamma=0.003862$, $\lambda=0.010161$ \\ \addlinespace
    & Algorithm 1       & $n=39$, $\gamma =0.001229$, $\lambda=0.034972$, $L=39$ \\ 
    \addlinespace
    & Algorithm 2       &   $n=50$, $\gamma =0.009$, $\lambda=0.01$, $L=100$  \\ 
    \addlinespace
    & Algorithm 3&   $n=50$, $\gamma_{pu} =0.004815$, $\gamma_{qi} =0.006103$, $\lambda_{pu}=0.09$, $\lambda_{qi}=0.09$  \\
    \addlinespace
    & Algorithm 4 & $n=50$, $\gamma_{pu} =0.004815$, $\gamma_{qi} =0.006103$, $\gamma_{bu} =0.006103$, $\gamma_{bi} =0.006103$, $\lambda_{pu}=0.09$, $\lambda_{qi}=0.09$, $\lambda_{bu}=0.09$, $\lambda_{bi}=0.09$   \\  
    \addlinespace
    & Algorithm 5 & $n=50$, $\gamma_{pu} =0.004815$, $\gamma_{qi} =0.006103$, $\gamma_{bu} =0.006103$, $\gamma_{bi} =0.006103$, $\lambda_{pu}=0.09$, $\lambda_{qi}=0.09$, $\lambda_{bu}=0.09$, $\lambda_{bi}=0.09$   \\  
    \bottomrule
\end{tabularx}
    \caption{.}
\end{table}
\end{document}

在此处输入图片描述

相关内容