Search code examples
latexmargintabular

LaTeX: margin lines in tabular form


I'm writing a CV in latex, using a two-column tabular. The problem is some of my lines have no margin and this makes a bad appearance at the document.

I used this Code:

\documentclass[letterpaper,11pt,oneside]{article}
\usepackage[left=1 in, right=1.5 in, bottom=1.25 in, top=1.25 in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage{xcolor}
\usepackage{tcolorbox}
\author{XXX}
\title{YYY}


\pagenumbering{gobble}

\begin{document}


\noindent \begin{tabular}{@{} l l}
 \Large{Education}    
     &\textbf{ZZZ} \\
     & nnnnn nnnn nn nnnnn nnnn nnnn nnn nnnn nnnn nnn nnnnnn  nnn nnnn nnnn nnn nnn nnnnnnn nnn nnnn nnn\\

\end{tabular}
\end{document}

That's my result:

enter image description here

How can I fix this?


Solution

  • You could either user the tabularx package (see e.g. this answer) or the p argument:

    \begin{tabular}{@{} l p{0.8\textwidth}}
        \Large{Education}    
             &\textbf{ZZZ} \\
             & nnnnn nnnn nn nnnnn nnnn nnnn nnn nnnn nnnn nnn nnnnnn  nnn nnnn nnnn nnn nnn nnnnnnn nnn nnnn nnn\\
    \end{tabular}