Left-align data in first column of table and not in header

I am using the following code to format my tables for my thesis (template based on this question here: Wrap text in table column header AND fit table width to pagewidth

\usepackage[utf8]{inputenc}
\usepackage{fourier}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{makecell}

\newcolumntype{Z}{ >{\centering\arraybackslash}X }

\usepackage[autolanguage, np]{numprint}

\begin{document}

\begin{table}[!h]
\setlength\tabcolsep{4pt}
\begin{tabularx}{\textwidth}{*{4}{Z}}
\toprule
\multicolumn{4}{c}{xxx xx xxxx}   \\
\midrule
\midrule
abcd efg hijka  & $-1.854$                                                & \np{9.52E-11}        & \np{8.41E-10}                         \\
abcd efg hijka  & $-1.815$                                                & \np{3.38E-09}        & \np{2.42E-08}                         \\
\bottomrule
\end{tabularx}
\end{table}
a lot of text here to show text width a lot of text here to show text width a lot of text here to show text width a lot of text here to show text width a lot of text here to show text width a lot of text here to show text width a lot of text here to show text width

\end{document}


I was wondering how can I left align only the data in the first column of this table? Is there an easy way to maybe change the \newcolumntype{Z}{ >{\centering\arraybackslash}X } command to only leftalign data in the first column of the table and not the header? The other columns and headers should remain centered.

• Welcome to TeX.SX! Declare the first column as l and input the header with \multicolumn{1}{c}{Header} – egreg Jan 4 '18 at 20:41

This code should do it:

\begin{table}[!h]
\setlength\tabcolsep{4pt}
\begin{tabularx}{\textwidth}{X*{3}{Z}}
\toprule
\multicolumn{4}{c}{xxx xx xxxx}   \\
\cmidrule(lr){1-4}
abcd efg hijka  & $-1.854$                                                & \np{9.52E-11}        & \np{8.41E-10}                         \\
abcd efg hijka  & $-1.815$                                                & \np{3.38E-09}        & \np{2.42E-08}                         \\

since an Xcolumn, by default, is left-aligned, but \thead is centred (vertically and horizontally).
Additionally, I think \cmidrule(lr){1-4} between the first two rows will look nicer than \midrule.