# Format issues in longtable (left alignment of cells plus different cell lenght)

I got a longtable with rows containing more or less information. I want to achieve a left alignment because of justification errors plus different lengths in row size (horizontally). My current solution results in strange behaviour. It seems as definition of newcolumtype overrides my settings in table.

How can I control both of it? Left alignment + different cell lengths?

\documentclass{article}
\usepackage{lipsum}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{array}
\newcolumntype{L}{>{\raggedleft\arraybackslash}p{1cm}}
\begin{document}
\begin{longtable}{Lp{8cm} Lp{4cm}}\toprule
col1 & col2 \\\midrule
\lipsum[1] & \lipsum[2]  \\ \bottomrule
\end{longtable}
\end{document}


You are setting up four columns in your longtable. If you want to use the L-column with an argument to set the width do it like this:

\documentclass{article}
\usepackage{lipsum}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedleft\arraybackslash}p{#1}}
\begin{document}
\begin{longtable}{L{8cm} L{4cm}}\toprule
col1 & col2 \\\midrule
\lipsum[1] & \lipsum[2]  \\ \bottomrule
\end{longtable}
\end{document}


• Thanks a lot Ulrike! To-the-point solution! :-) – Jens Jan 7 at 14:00