[Tex/LaTex] How to draw this complex table in LaTeX

tables

How can I draw the following table in LaTeX?

Enter image description here

I tried this code, but it was not so good:

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}

\usepackage{geometry}
\geometry{a4paper,left=3.5cm,right=3.5cm,top=3cm,bottom=3cm}

\begin{document}

\begin{table}[h!]
    \caption{A complex example for handling tables.}
    \centering
     Coefficients of friction\\
    \begin{tabular}{||c|l|l|c|l||}
    \hline\hline \multicolumn{2}{||c|} { Static friction } &  & \multicolumn{2}{|c||} { Sliding friction } \\
    \cline { 1 - 5} dry and clean & lubricated &  & dry and clean & lubricated \\
    \hline \hline $0.15$ & $0.111$ & steel on steel & $0.14$ & $0.001$ \\
    $0.19$ & $0.1$ & steel on iron & $0.18$ & $0.001$ \\
    \hline\hline
    \end{tabular}
    \label{tab:my_label}

\end{table}

\end{document}

Best Answer

I'd like to propose you choose a layout that's quite different from the screenshot shown in your query. While that layout features a certain hierarchy of objects, the multitude of line styles give it a rather busy and cluttered, even baroque, "look", with the material in the table's header looking quite cramped -- uncomfortably so, in fact.

I would like to propose using a less cluttered look, one which invites your readers to linger a while and actually study and absorb the table's contents.

enter image description here

\documentclass{article}
\usepackage{array,booktabs,siunitx}
\newcolumntype{T}[1]{S[table-format=#1]}
\usepackage[skip=0.333\baselineskip]{caption}
\begin{document}
\begin{table}
\caption{A complex example for handling tables}
\centering
\begin{tabular}{@{} l *{2}{T{1.2}T{1.3}} @{}}
\toprule
Material pairings & \multicolumn{4}{c@{}}{Coefficients of friction}\\
\cmidrule(l){2-5}
& \multicolumn{2}{c}{Static friction} 
& \multicolumn{2}{c@{}}{Sliding friction} \\
\cmidrule(lr){2-3} \cmidrule(l){4-5}
& {dry and clean} & {lubricated} & {dry and clean} & {lubricated} \\
\midrule
Steel on steel & 0.15 & 0.111 & 0.14 & 0.001 \\
Steel on iron  & 0.19 & 0.1   & 0.18 & 0.001 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Related Question