[Tex/LaTex] Math operations on lengths

calculationslengthstables

I have a table with three columns and I want the table to be distributed on \textwidth of the page.

I tried:

\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\textwidth/3}{| c | c | c |} %Math operation here.
\hline
looooooong & long & very loooong \\
long & very looooooong & long\\
\hline
\end{tabularx}
\end{document}

Best Answer

\documentclass{article}
\usepackage{tabularx}
\usepackage{lipsum}
\begin{document}
\noindent
\begin{tabularx}{\textwidth}{| X | X | X |} \hline
        \lipsum[5] & \lipsum[5] & \lipsum[5]\\\hline
\end{tabularx}

\noindent
\begin{tabularx}{\textwidth}{
    | >{\hsize=0.5\hsize}X 
    | X 
    | >{\hsize=1.5\hsize}X |} \hline
    \lipsum[5] & \lipsum[5] & \lipsum[5]\\\hline
\end{tabularx}

\end{document}

enter image description here

enter image description here

If you need the possibility of a pagebreak then use xltabular instead.

Related Question