I need to use xltabular
for a complex table. The MDPI template has an example of a tabularx
on full width that I am trying to replicate:
\documentclass[journal,article,submit,pdftex,moreauthors]{Definitions/mdpi}
\firstpage{1}
\makeatletter
\setcounter{page}{\@firstpage}
\makeatother
\pubvolume{1}
\issuenum{1}
\articlenumber{0}
\pubyear{2022}
\copyrightyear{2022}
\datereceived{}
\dateaccepted{}
\datepublished{}
\hreflink{https://doi.org/}
\Title{Title}
\Author{Firstname Lastname}
\AuthorNames{Firstname Lastname}
\address{%
$^{1}$ \quad Affiliation 1; [email protected]
}
\begin{document}
\begin{table}[H]
\caption{This is a wide table.\label{tab2}}
\begin{adjustwidth}{-\extralength}{0cm}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{tabularx}{\fulllength}{CCCC}
\toprule
\textbf{Title 1} & \textbf{Title 2} & \textbf{Title 3} & \textbf{Title 4}\\
\midrule
Entry 1 & Data & Data & Data\\
Entry 2 & Data & Data & Data \textsuperscript{1}\\
\bottomrule
\end{tabularx}
\end{adjustwidth}
\noindent{\footnotesize{\textsuperscript{1} This is a table footnote.}}
\end{table}
\end{document}
However, when I attempt the following I don't get the result I hoped for:
\documentclass[journal,article,submit,pdftex,moreauthors]{Definitions/mdpi}
\usepackage{xltabular}
\firstpage{1}
\makeatletter
\setcounter{page}{\@firstpage}
\makeatother
\pubvolume{1}
\issuenum{1}
\articlenumber{0}
\pubyear{2022}
\copyrightyear{2022}
\datereceived{}
\dateaccepted{}
\datepublished{}
\hreflink{https://doi.org/}
\Title{Title}
\Author{Firstname Lastname}
\AuthorNames{Firstname Lastname}
\address{%
$^{1}$ \quad Affiliation 1; [email protected]
}
\begin{document}
\begin{table}[H]
\caption{This is a wide table.\label{tab2}}
\begin{adjustwidth}{-\extralength}{0cm}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{xltabular}{\fulllength}{CCCC}
\toprule
\textbf{Title 1} & \textbf{Title 2} & \textbf{Title 3} & \textbf{Title 4}\\
\midrule
Entry 1 & Data & Data & Data\\
Entry 2 & Data & Data & Data \textsuperscript{1}\\
\bottomrule
\end{xltabular}
\end{adjustwidth}
\noindent{\footnotesize{\textsuperscript{1} This is a table footnote.}}
\end{table}
\end{document}
How can I generate a full-width xltabular
table?