I have a threeparttable in which its cells are needed to be centered. I have tested all \centering and \begin{center}…\end{center} commands. But these commands do not work! Although there is no error, the texts in the cells are still left aligned. This is my table:
\documentclass{elsart5p}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{threeparttable}
\begin{document}
\begin{threeparttable}
%\centering
\begin{center}
\caption{myTable}\label{tab:table1}
\setlength{\tabcolsep}{6pt}
\begin{tabular}[width=\linewidth]{p{0.6\linewidth}p{0.4\linewidth}}
\toprule
Header Header Header Header Header Header Header Header Header Header1&Header Header Header Header Header2\\
\midrule
col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1 col1* & col2 col2 col2 \\
cell3 cell3& cell4 cell4 cell4 cell4 cell4\\
\bottomrule
\end{tabular}
\begin{tablenotes}
\item *Star: important
\end{tablenotes}
\end{center}
\end{threeparttable}
\end{document}
The texts to be written in some cells are too long, so I had to use \begin{tabular}[width=\linewidth]{p{0.6\linewidth}p{0.4\linewidth}} command to break the text of each cell into two or three lines.
How can I centerize this table?

\begin{center}...\end{center}environment will centre the whole table, but not the cells whose alignment is specified in the options for\begin{tabular}. Specifically, you currently have two columns which are justified, given byp{0.6\linewidth}p{0.4\linewidth}. This answer will show you how to make these centered: https://tex.stackexchange.com/questions/5017/center-column-with-specifying-width-in-table-tabular-enviroment/5020#5020 – rbrignall Feb 11 '20 at 12:59tabularenvironment exceeds\linewidthis that the total width of a cell is the sum of its usable width and the left-hand and right-hand padding (in the amount of\tabcolsepeach). Hence, the width of yourtabularenvironment is actually\linewidth+4\tabcolseprather than just\linewidth. In the answer I just posted, I suggest you switch to atabularxenvironment and specify (a) the intended overall width (here:\linewidth) and (b) the relative column widths (here: 3 to 2, or 1.2 to 0.8). – Mico Feb 11 '20 at 13:45