0

I am using longtable and want to specify the width of a column, however this does not work for me, first column need to be 2 cm for instance:

\documentclass[11pt,a4paper]{report}
\usepackage{longtable}
\begin{document}
\begin{longtable}{l{2cm}l}
A & B
\end{longtable}
\end{document}
8
  • 2
    p{2cm} or define a new columntype using the array package
    – user31729
    Feb 20, 2018 at 20:28
  • 2
    A longtable environment is always centered.... so flushing to the side could be a little difficult. You can use @p{2cm} to get at least rid of some small spacing at the left margin. And please, don't change the question in comments...
    – user31729
    Feb 20, 2018 at 20:37
  • 1
    Sorry, I meant @{}p{2cm} of course...
    – user31729
    Feb 20, 2018 at 20:45
  • 2
    \begin{longtable}[l]{@{}p{2cm}l@{}} Feb 20, 2018 at 21:47
  • 1
    @DavidCarlisle Well, let's assume I just forgot about [l] ;-)
    – user31729
    Feb 20, 2018 at 21:52

1 Answer 1

1

You can use

\begin{longtable}[l]{@{}p{2cm}l@{}}

to left align the table ([l]), have no left border space in the first column {@{}), and set the first column in a parbox of width 2cm (p{2cm}).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.