[Tex/LaTex] Justify text when using a tabular environment

horizontal alignmentspacingtables

I'm using

\documentclass[10pt,twocolumn]{article}

\usepackage{hhline}
\usepackage[left=1cm,right=1cm,top=1cm,bottom=2cm]{geometry}

\addtolength{\columnsep}{0.4cm}
\addtolength{\textwidth}{\columnsep}

\setlength\parindent{0pt}

\begin{document}

\begin{tabular}{ll}
1 & Aron climbed down a narrow gap between  \\
2 & the walls of the canyon. Suddenly a large  \\
3 & rock fell on his right arm. It trapped his arm  \\
4 & against the canyon wall. He tried to pull is  \\
5 & arm out, but the rock weighed 360 kilograms.\\
\end{tabular}

\end{document}

I'd like to have the four lines of each long text justified, is there way to accomplish this?


I've added a more complete example to show what I want.

Best Answer

I'm assuming this is what you want, but it will ultimately look awful (or a LaTeX imitation of MSWord...)

To number the lines, I've just made a counter, which will save you some typing. For the spacing, I've used a macro from Bruno LeFloch which splits space delimited text and applies a macro to it. I've then appended \hfill to each word in the cell, using the collectcell package. This fills out each line with as much space as needed to fill the line width. Ugh. :)

\documentclass[10pt,twocolumn]{article}

\usepackage{array}
\usepackage{collcell}
\usepackage{xparse}
\usepackage{etoolbox}

\ExplSyntaxOn
% This macro based on https://tex.stackexchange.com/a/25704/
\NewDocumentCommand {\hfillspace}
  { > { \SplitList { ~ } } m }
  { \tl_map_inline:nn {#1} { ##1\hfill } }
\ExplSyntaxOff

\newcounter{myline}
\AtBeginEnvironment{tabular}{\setcounter{myline}{0}}

\begin{document}
\begin{tabular}{>{\stepcounter{myline}\themyline\quad\collectcell\hfillspace}p{.9\columnwidth}<{\endcollectcell}}
Aron climbed down a narrow gap between\\
the walls of the canyon. Suddenly a large\\
rock fell on his right arm. It trapped his arm\\
against the canyon wall. He tried to pull is\\
arm out, but the rock weighed 360 kilograms. 
\end{tabular}
\end{document}

enter image description here

Related Question