Tables – Fixing Missing Border Lines in LaTeX Table

document-classespdftextables

Once again when porting Latex Table code from one journal to springer format I am getting missing border lines( image attached). Latex code is as follows. Please suggest solution for missing border and auto line breaking to fit page width instead of manual I have done using \\

\usepackage{adjustbox} 
%\usepackage{tabularx}
\usepackage{tabularx,ragged2e}
\documentclass{sn-jnl}
\begin{document}

    \begin{table*}[!h]
        %\tiny
        \centering
        \small
        \caption{Result}
        \begin{tabular}{|c|c|c|c|}
            \hline
            \multicolumn{1}{|l|}{\begin{tabular}[c]{@{}l@{}}Users Set\\Size (USS)\end{tabular}} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}} Range of Users \\ Individual \end{tabular}} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Index of scalar array \\ for mapping\end{tabular}} & \multicolumn{1}{l|}{\begin{tabular}[c]{@{}l@{}}Transfer \\ Failure\end{tabular}} \\ \hline
            \multirow{6}{*}{6}                                                                        & \multirow{2}{*}{6}                    & 10                                                                                                       & 23                                                                                           \\ \cline{3-4} 
            &                                       & 4                                                                                                      & \textbf{18.3}                                                                                           \\ \cline{2-4} 
            & \multirow{2}{*}{7}                    & 0                                                                                                      & 13.3                                                                                          \\ \cline{3-4} 
            &                                       & 4                                                                                                       & \textbf{33.3}                                                                                           \\ \cline{2-4} 
            & \multirow{2}{*}{7}                    & 1                                                                                                       & 17                                                                                           \\ \cline{3-4} 
            &                                       & 2                                                                                                       & \textbf{66.6}                                                                                           \\ \hline
        \end{tabular}
   \end{table}

\end{document}

enter image description here

Best Answer

With tabularray and siunitx packages problems with vertical lines are eliminated and numbers in the last column are aligned at decimal points:

\documentclass{sn-jnl}

\usepackage{xcolor}
\usepackage{tabularray}
\UseTblrLibrary{siunitx}

\begin{document}
    \begin{table*}[ht]
    \caption{Result}
\sisetup{table-format=2.1,
         detect-weight, % <--
         }
\begin{tblr}{hlines, vlines,
             colspec = {X[c] X[1.2,c] X[1.8,c] X[c, si]},
             cell{even}{2} = {r=2}{},
             cell{odd[3]}{Z} = {font=\bfseries},
             row{1} = {guard}
             } 
Users Set Size (USS)
    &   Range of Users Individual
        &   Index of scalar array for mapping
            &   Transfer Failure        \\
\SetCell[r=6]{c}    6
    & 6 & 10& 23                        \\
    &   & 4 & 18.3                      \\
    & 7 & 0 & 13.3                      \\
    &   & 4 & 33.3                      \\
    & 7 & 1 & 17                        \\
    &   & 2 & 66.6                      \\
\end{tblr}
   \end{table*}
\end{document}

enter image description here

Related Question