one more answer ...
- used packages
newtxtext
and newtxmath
as in egreg answer
- for row coloring used
\rowcolors{3}{mygray}{white}
similarly as in Bernard answer
- for multi line cells is used
makecell
from the package makecell
, but they are determined as option of the first column (for shorter code)
edit:
the package arydshln
is not compatible with many packages ... so it is cause of your problem: it doesn't "like" multi line cells constructed with inserting tabular
environments or use of the makecell
macro (which is based tabular
).
as work around can be:
- make necessary changes in your preamble which is needed for work of my solution (replace
ansmath
with mathtools
, and color
and colortbl
with [...,table]{xcolor}
, see comments in my mwe below) and will not influence on your real document
- not use
makcell
as i did in my first propose
- instead
makcell
use column type m{...}
corrected code is:
\documentclass[preprint,12pt]{elsarticle}
\biboptions{sort&compress}
\usepackage{subcaption}
\captionsetup{compatibility=false}
\usepackage{amssymb}
\usepackage{newtxtext,newtxmath} % better than mathptmx
%\usepackage{amsmath} % for my answer should be replaced by "mathtools"
\usepackage{mathtools} % mathtools load "amsmath"
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator{\sign}{sign}
\newtheorem{thm}{Theorem}
\newproof{pf}{Proof}
\newtheorem{lemma}{Lemma}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{array}
\usepackage{siunitx}
%\usepackage[usenames, dvipsnames]{color}% better merge with "colortbl" package into "[table]{xcolor}"
% my solution doesn't wirk with this package
%\usepackage{colortbl} % better merge with "color" package into "[table]{xcolor}"
\usepackage[usenames, dvipsnames,table]{xcolor}
\definecolor{mygray}{gray}{0.925}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\begin{document}
\begin{table}[htb]
\sisetup{detect-all}
\rowcolors{3}{mygray}{white}
\centering
\begin{tabular}{
>{$L_1=100$\newline
$L_2=100$} m{11 ex}@{}
>{\bfseries}S[table-format=1.4]
*{2}{>{\bfseries}S[table-format=3.4]}
>{\bfseries}S[table-format=2.4]
}
\toprule
\multicolumn{1}{l}{Initial gains}
&{$x_1$}
& {$\max(F)$}
& {$\max(\abs{\tau_1})$}
& {$\max(\abs{\tau_2})$}
\\
\midrule
& 0.6221 & 121.2892 & 149.8136 & 27.9641 \\
& 0.6221 & 120.5161 & 149.4271 & 34.7235 \\
& 0.6213 & 112.7963 & 148.2077 & 28.1165 \\
& 0.6213 & 112.7133 & 148.0053 & 34.9203 \\
& 0.6207 & 107.3273 & 281.3320 & 56.0344 \\
& 0.6193 & 92.9236 & 145.1045 & 35.5135 \\
& 0.6192 & 91.6388 & 281.3320 & 56.3469 \\
& 0.6187 & 86.6108 & 418.2479 & 76.9534 \\
& 0.6180 & 80.0001 & 281.3320 & 56.6598 \\
& 0.6189 & 89.1374 & 142.7592 & 30.0929 \\[-\aboverulesep]
\bottomrule
\end{tabular}
\caption{Numerical values}
\label{t1}
\end{table}
\end{document}

edit (2):
in case, that you not like boldface numbers in table, than you only need to remove >{\bfseries}
in S
column type definitions.
edit (3):
the final version of the answer. it consider all your additional requests from your comments below answer:
\documentclass[preprint,12pt]{elsarticle}
\biboptions{sort&compress}
\usepackage{subcaption}
\captionsetup{compatibility=false}
\usepackage{amssymb}
\usepackage{newtxtext,newtxmath}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator{\sign}{sign}
\newtheorem{thm}{Theorem}
\newproof{pf}{Proof}
\newtheorem{lemma}{Lemma}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{array}
\usepackage{siunitx}
%\usepackage[usenames, dvipsnames]{color}% better merge with "colortbl" package into "[table]{xcolor}"
% my solution doesn't wirk with this package
%\usepackage{colortbl} % better merge with "color" package into "[table]{xcolor}"
\usepackage[usenames, dvipsnames,table]{xcolor}
\definecolor{mygray}{gray}{0.925}
\usepackage{arydshln}
\setlength\dashlinedash{0.2pt}
\setlength\dashlinegap{1.5pt}
\setlength\arrayrulewidth{0.3pt}
\begin{document}
\begin{table}[htb]
\sisetup{detect-all}
\rowcolors{3}{mygray}{white}
\centering
\begin{tabular}{
>{\raggedright\arraybackslash}m{11 ex}
S[table-format=1.4]
*{2}{S[table-format=3.4]}
S[table-format=2.4]
}
\toprule
\multicolumn{1}{l}{Initial gains}
& {$x_1$} & {$\max(F)$} & {$\max(\abs{\tau_1})$}
& {$\max(\abs{\tau_2})$}
\\
\midrule
$L_1 = 100$ $L_2=111$
& 0.6221 & 121.2892 & 149.8136 & 27.9641 \\
$L_1 = 101$ $L_2=112$
& 0.6221 & 120.5161 & 149.4271 & 34.7235 \\
$L_1 = 102$ $L_2=113$
& 0.6213 & 112.7963 & 148.2077 & 28.1165 \\
$L_1 = 103$ $L_2=114$
& 0.6213 & 112.7133 & 148.0053 & 34.9203 \\
$L_1 = 104$ $L_2=115$
& 0.6207 & 107.3273 & 281.3320 & 56.0344 \\
$L_1 = 105$ $L_2=116$
& 0.6193 & 92.9236 & 145.1045 & 35.5135 \\
$L_1 = 106$ $L_2=117$
& 0.6192 & 91.6388 & 281.3320 & 56.3469 \\
$L_1 = 107$ $L_2=118$
& 0.6187 & 86.6108 & 418.2479 & 76.9534 \\
$L_1 = 108$ $L_2=119$
& 0.6180 & 80.0001 & 281.3320 & 56.6598 \\
$L_1 = 109$ $L_2=120$
& 0.6189 & 89.1374 & 142.7592 & 30.0929 \\[-\aboverulesep]
\bottomrule
\end{tabular}
\caption{Numerical values}
\label{t1}
\end{table}
\end{document}