I want to have a list of texts in a document, and I use the "longtable" package to make the list. The codes as as following.
\documentclass{article}
\usepackage{longtable}
\begin{document}
\begin{longtable}[h]{|p{0.2\textwidth}|p{0.60\textwidth}|p{0.2\textwidth}|}
\multicolumn{2}{l}{\textbf{texts}}\\
text 1-1 &text 1-2 &text 1-3 \\
text 2-1 &text 2-2 &text 2-3 \\
text 3-1 &text 3-2 &text 3-3 \\
text 4-1 &text 4-2 &text 4-3 \\
text 5-1 &text 5-2 &text 5-3 \\
text 6-1 &text 6-2 &text 6-3 \\
\end{longtable}
\end{document}
The document is as following.
The texts are left aligned by default.
The question is, I want to set the first and second column as "left align" and the thrid column as "right align".
While, it seems that I can not use {llr} and {|p{0.2\textwidth}|p{0.60\textwidth}|p{0.2\textwidth}|} at the same time.
Then, how could I set the the width of column and set the align?

>{\raggedleft\arraybackslash}before thep{…}you want right aligned. See the manual of packagearrayfor more information. – cabohah Jul 12 '23 at 14:27w{r}{0.2\textwidth}from thearraypackage – samcarter_is_at_topanswers.xyz Jul 12 '23 at 14:30longtableis to wide, because0.2\textwidth+0.6\textwidth+0.2\textwidth+6\tabcolsep(two for each column) are already >\textwidth. You either should reduce the width of at least one column or maybe you want to use packagexltabularortabularrayto avoid such issues. And please note, that environmentlongtabledoes not support option[h]only[c],[l]and[r]are supported. See Table 7 in thelongtablemanual for more information. – cabohah Jul 12 '23 at 16:04