Problem solved: Package ltablex was loaded before tabularx and thus it didn't work. Using tabularx is working now!
So I would like to set up a table over the whole textwidth with two columns. It's almost working, except the right column is shifted to the right and I don't know how to fix this.
I tried to adapt the solution from this question: Setting table-width exactly to linewidth and this is the code
\documentclass[a4paper, 11pt, oneside]{scrbook}
%\usepackage{tabularx}
\begin{document}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}|l|l|}
\hline
left column & right column \\
\hline
left column & right column
\hline
\end{tabular*}
\end{document}
but this is the result:
Why is the right column so much shifted to the right? And the left column has zero space to the right. How can I fix this so that the left column uses as much space as needed and the right column fills the linewidth?
My desired output should look like this:
With the left column only using as much space as needed and the right column filling up the rest of the horizontal space.
I already tried it with tabularx but this isn't working either:
\documentclass[a4paper, 11pt, oneside]{scrbook}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\linewidth}{|X|X|}
\hline
left column & right column \\
\hline
left column & right column \\
\hline
\end{tabularx}
\end{document}
Here is the result:
Thanks in advance!





\noindentbefore the table. ->\noindent \begin{tabular*}. WIth \usepackage{showframe} you could visualize margins. – Bobyandbob Nov 19 '17 at 21:28tabularxpackage and its flexible widthXcolumn? – leandriis Nov 19 '17 at 21:30tabularx. – leandriis Nov 19 '17 at 21:37\tabcolsep. consequently it is extended to text in second column. what you like actually achieve? equal width of cells? – Zarko Nov 19 '17 at 21:38\tablexwithout specifying\keepXColumns? – Bernard Nov 19 '17 at 21:47