[Tex/LaTex] Centering texts in tabularx

horizontal alignmenttabularx

It is my first question on this site. I am not sure my LaTeX code will be well written here. Here is my table code. The problem is that the text in the first four columns are not centered in respect to each cell. When I write a small text in the X column , the content of the others four culumns are well centered. But it is not the case when i put a long text in the last colum X. Note that the content of the X column have to be justified. What is the solution to that?

\begin{sidewaystable}[h]
\footnotesize
\centering
\renewcommand{\arraystretch}{1.5}
\begin{tabularx}{\textwidth}{c >{\centering\arraybackslash}m{1.5cm} >{\centering\arraybackslash}m{4.3cm} X}
\hline
text & text  & text & text & very big text \\
\hline
 text & text & text & text & VERY BIG TEXT \\
\hline
 text & text & text & text &  VERY BIG TEXT \\
\hline
\end{tabularx}
\captionsetup{justification=centering,margin=2cm,font={small}}
\caption{.........}
\captionsetup{font={scriptsize}}
\label{.....}
\caption*{......}
\end{sidewaystable}

Best Answer

Your example is modified to show important fragments. Therefore, e.g. sidewaystable is changed onto table.

\begin{document}

%\begin{sidewaystable}[h]
\begin{table}[h]
\footnotesize
\centering
\renewcommand{\arraystretch}{1.5}
%\begin{tabularx}{\textwidth}{c >{\centering\arraybackslash}m{1.5cm} >{\centering\arraybackslash}m{4.3cm} X}
\def\tabularxcolumn#1{m{#1}} % PS (3)
\begin{tabularx}{\textwidth}{c >{\centering\arraybackslash}m{1.5cm} >{\centering\arraybackslash}m{4.3cm} cX}

\hline
%text & text  & text & text & very big text \\
text & text  & text & text  & very big text \\
\hline
% text & text & text & text & VERY BIG TEXT \\
text & text  & text  &  text  &very big text \\
\hline
% text & text & text & text &  VERY BIG TEXT \\
text text & text text text  & text   text text text  text text text text text text  &text & very big text 
 text text text  text text text  text text text 
\\
\hline
\end{tabularx}
%\captionsetup{justification=centering,margin=2cm,font={small}}
\caption{.........}
%\captionsetup{font={scriptsize}}
%\label{.....}
%\caption*{......}
%\end{sidewaystable}
\end{table}

\end{document}

enter image description here