[Tex/LaTex] Vertical and horizontal alignment with tabu package

horizontal alignmenttablestabuvertical alignment

Another question led me to use tabu for the purpose of fitting one column to its content while allowing the others to stretch equally. This is my current code:

\documentclass{article}
\usepackage{tabu} 

\begin{document}
\noindent
\begin{tabu}{|X[m,c]|c|X[m,c]|}
    Left content centered \newline between margin and title &
    {\Huge Title} &
    Right content \newline also centered
\end{tabu}

\end{document}

However this produces two problems: some weird horizontal alignment on the two-line cells, and the title is not vertically centered with the left and right cell.

What is causing these issues and how can I fix them?

Best Answer

tabu also allows the use of negative coefficients to use on X columns so that one can have all the features of the X columns without the scaling part. This therefore eliminates the need to the raisebox "hack". All you need is change your c column to X[-1,m,c]

\documentclass{article}
\usepackage{tabu} 

\begin{document}
\noindent
\begin{tabu}{|X[m,c]|X[-1,m,c]|X[m,c]|}
    Left content centered \linebreak between margin and title &
    \Huge Title &
    Right content \linebreak also centered
\end{tabu}

\end{document}

enter image description here