Выравнивание по левому краю в таблице описания переменных

Выравнивание по левому краю в таблице описания переменных

Я не могу понять, почему в следующем коде (возможно, мне нужно немного отшлифовать преамбулу, я знаю), я не могу выровнять "Variables" по левому краю. Я пробовал разные решения, но они все равно остаются по центру.

Другая (незначительная и менее важная) проблема заключается в том, что я пытался изменить порядок столбцов, поместив описание в конец. Однако я всегда получаю сообщение об ошибке. Есть идеи?

\documentclass[11pt]{article}
\usepackage{rotating}

\usepackage{longtable}
\usepackage[labelfont=bf, labelsep=newline, justification=centering, textfont=it]{caption}
\usepackage{adjustbox}
\usepackage{graphicx}
\usepackage{booktabs, makecell, siunitx}
\usepackage{eqparbox}
\pagenumbering{gobble}
\usepackage{booktabs}
\usepackage[referable,para]{threeparttablex}
\usepackage[a4paper,margin=1.5cm]{geometry}
\usepackage{multirow}
\usepackage{pdflscape}
\usepackage{stackengine}
\usepackage{interval}
\usepackage{amsmath,ragged2e} % <-- new
\usepackage{interval,pbox}

\usepackage{booktabs,tabularx}

\sisetup{group-separator={,}, table-format=1.3, table-space-text-post=***, 
table-number-alignment =center}
\newcommand*{\MyIndent}
{\hspace*{1.5cm}}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro

\newcommand\mytab[1]{%
   \smash[b]{\begin{tabular}[c]{@{}c@{}}#1\end{tabular}}}
\hyphenation{bur-kina}

\begin{document}

\begin{table}
\renewcommand{\arraystretch}{1.5} 

\caption{Descriptions of variables\label{A1}}
\begin{tabularx}{\textwidth}{@{}lXSS@{}}
\toprule
\multicolumn{1}{l}{Variables}&\mc{Description}&\mc{Mean}&\mc{SD}\\
\midrule
Health&Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows. Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows&\mc{0.8049}&\mc{0.3928}\\
Age&Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows&\mc{49.16}&\mc{15.82}\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}

решение1

Что-то вроде этого?

\documentclass[11pt]{article}
\usepackage{rotating}

\usepackage{longtable}
\usepackage[labelfont=bf, labelsep=newline, justification=centering, textfont=it]{caption}
\usepackage{adjustbox}
\usepackage{graphicx}
\usepackage{booktabs, makecell, siunitx}
\usepackage{eqparbox}
\pagenumbering{gobble}
\usepackage{booktabs}
\usepackage[referable,para]{threeparttablex}
\usepackage[a4paper,margin=1.5cm]{geometry}
\usepackage{multirow}
\usepackage{pdflscape}
\usepackage{stackengine}
\usepackage{interval}
\usepackage{amsmath,ragged2e} % <-- new
\usepackage{interval,pbox}

\usepackage{booktabs,tabularx}

\sisetup{group-separator={,}, table-format=1.3, table-space-text-post=***, 
table-number-alignment =center}
\newcommand*{\MyIndent}
{\hspace*{1.5cm}}
\usepackage{dcolumn}
\newcolumntype{d}[1]{D..{#1}}
\newcommand\mc[1]{\multicolumn{1}{c}{#1}} % handy shortcut macro

\newcommand\mytab[1]{%
   \smash[b]{\begin{tabular}[c]{@{}c@{}}#1\end{tabular}}}
\hyphenation{bur-kina}

\begin{document}

\begin{table}
\renewcommand{\arraystretch}{1.5} 

\caption{Descriptions of variables\label{A1}}
\begin{tabularx}{\textwidth}{@{}lXSS@{}}
\toprule
\multicolumn{1}{@{}l}{Variables}&\mc{Description}&\mc{Mean}&\mc{SD}\\ % @{} here
\midrule
Health&Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows. Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows&\mc{0.8049}&\mc{0.3928}\\
Age&Test of a really long description which should itself span many rows, in fact occupying much space, hopefully, causing it to span a couple of normal rows&\mc{49.16}&\mc{15.82}\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}

введите описание изображения здесь

Связанный контент