3

I am trying to build a table on LaTeX with Parbox. I have found how to do with \parbox. However, the length between rows makes the text so pack. Do you know how to increase the length?

I have tried with \parbox[15em]{108pt}{\raggedright according to: \parbox[position][height][inner-pos]{width}{text} included on herbert.the-little-red-haired-girl.org/html/latex2e/… However, I don't get the space between the rows :(

My table code is given below:

\documentclass{article}
\usepackage{multirow}

\begin{document}

{\raggedright
\vspace{3pt} \noindent
\begin{tabular}{|p{108pt}|p{223pt}|p{52pt}|}
\hline
\parbox{108pt}{\raggedright 
Attribute
} & \parbox{223pt}{\raggedright 
Description
} & \parbox{52pt}{\raggedright 
Characteristic
} \\
\hline
\parbox{108pt}{\raggedright 
Language
} & \parbox{223pt}{\raggedright
Programming language of the source code.
} & \parbox{52pt}{\raggedright \multirow{5}{*}{
Project
}} \\
\cline{1-3}
\parbox{108pt}{\raggedright 
Team\_size
} & \parbox[70em]{223pt}{\raggedright
Number of active core team members during the last 3 months prior to creation.
} &  \\
\cline{1-3} 
\parbox[15em]{108pt}{\raggedright 
Perc\_external\_contribs
} & \parbox{223pt}{\raggedright 
Ratio of commits from external contributors over core team members in the last 3 months prior to creation of pull request.
} &  \\
\cline{1-2} 
\hline
\end{tabular}
\vspace{2pt}
\end{document}

Thank you for your help.

lockstep
  • 250,273
John Barton
  • 133
  • 3

1 Answers1

3

Since you are using p column type, there is no need for all those \parboxes. The \raggedright can be inserted in to the column defintion making the code tidy. I hace used \RaggedRight from ragged2e package to enable hyphenation. And at last \cline{1-3} has been changed to \cline{1-2}. And the width of columns have been specified as a fraction of line width instead of hard coded values.

\documentclass{article}
\usepackage{multirow}
\usepackage{array}
\usepackage{ragged2e}

\begin{document}

{\raggedright
\vspace{3pt} \noindent
\begin{tabular}{|>{\RaggedRight}p{0.275\linewidth}|>{\RaggedRight}p{0.55\linewidth}|
>{\RaggedRight\arraybackslash}p{0.18\linewidth}|}
\hline
Attribute
 &
Description
 &
Characteristic
 \\
\hline
Language
 &
Programming language of the source code.
 & \multirow{5}{*}{
Project
} \\
\cline{1-2}

Team\_size
 &
Number of active core team members during the last 3 months prior to creation.
 &  \\
\cline{1-2}
Perc\_external\_contribs
 &
Ratio of commits from external contributors over core team members in the last 3 months prior to creation of pull request.
 &  \\
\cline{1-2}
\hline
\end{tabular}
\vspace{2pt}
\end{document}

enter image description here