fiatlux wrote:...It works perfectly, but the text in the first column seems to be aligned to the left, but not where the margin is. It looks like it's aligned on 2.5 or 3cm. Can anybody tell me why?
It seems that you're not taking into account the indentation of the first line of paragraphs and the space between columns that LaTeX internally uses; the first additional space can be suppressed by using
\noindent (to suppress the paragraph indention); the second additional space can be suppressed by using the
@{} construct in the table format. Take a look at the following example:
Code: Select all
\documentclass{article}
\begin{document}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
\noindent\begin{tabular}{@{}p{5.5cm} p{4cm}@{}}
one & two \\
three & four \\
\end{tabular}
\end{document}
fiatlux wrote:PS: then I assumed that I had to force the alignment to the left, so I replace the first line with this one:
Code: Select all
\begin{tabular}{ >{\raggedright}p{5.5cm} p{4cm} }
but it generates an error.... why?
Without complete, minimal and compilable code (in the sense of a
minimal working example) all I can do is to guess (and I don't like that). Two possible causes come to my mind:
1) Perhaps you are not loading the array package (which implemements the >{} and <{} constructs).
2) Since
\raggedright (and also
\raggedleft and
\centering) internally redefine the line changing command \\ you will have to (a) use
\tabularnewline instead of the usual \\ to cange lines in the tabular environment or (b) to place
\arraybackslash right after
\raggedright.
An example:
Code: Select all
\documentclass{article}
\usepackage{array}
\begin{document}
\noindent\begin{tabular}{@{}>{\raggedright\arraybackslash}p{5.5cm} p{4cm}@{}}
one & two \\
three & four \\
\end{tabular}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...