# Wrap text in tabular and itemize?

I would like to get the following effect without manually using & and \\ to wrap the text (i.e., all the text will be wrapped automatically)

\documentclass[11pt,letterpaper]{article}
% Make lists without bullets and compact spacing
\renewenvironment{itemize}{
\begin{list}{}{
\setlength{\leftmargin}{1.5em}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0em}
\setlength{\parsep}{0.25em}
}
}{
\end{list}
}

\begin{document}

\section*{Main-Section}
\subsection*{Sub-Section}

\begin{itemize}
\item \begin{tabular}{@{}ll}
Title:             &This is not a title, this is perhaps a title, nobody but you know!\\
&This is not a title, this is perhaps a title, nobody but you know!\\
&This is not a title, this is perhaps a title, nobody but you know!\\
TitleAgain:             &This is not a title, this is perhaps a title, nobody but you know!\\
&This is not a title, this is perhaps a title, nobody but you know!\\
&This is not a title, this is perhaps a title, nobody but you know!\\
\end{tabular}
\end{itemize}

\end{document}


You could use a tabularx environment and set the required width to \linewidth. The text will wrap automatically in the X-column then. Depending on your use case, a description environment can be more handy. Code:

\documentclass[11pt,letterpaper]{article}
% Make lists without bullets and compact spacing
\newenvironment{myitemize}{
\begin{list}{}{
\setlength{\leftmargin}{1.5em}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0em}
\setlength{\parsep}{0.25em}
}
}{
\end{list}
}

\usepackage{enumitem,tabularx,showframe,calc}

\begin{document}

\section*{Main-Section}
\subsection*{Sub-Section}

\begin{myitemize}
\item
\begin{tabularx}{\linewidth}[t]{@{}lX@{}}
Title:  & This is not a title, this is perhaps a title, nobody but
you know!  This is not a title, this is perhaps a title,
nobody but you know!  This is not a title, this is
perhaps a title, nobody but you know!\tabularnewline
TitleAgain:
& This is not a title, this is perhaps a title, nobody
but you know!  This is not a title, this is perhaps a
title, nobody but you know!  This is not a title, this
is perhaps a title, nobody but you know!
\end{tabularx}
\end{myitemize}

\begin{description}[font=\normalfont,labelindent=1.5em,%
labelwidth=\widthof{TitleAgain:},leftmargin=!]
\item[Title:] This is not a title, this is perhaps a title, nobody but
you know!  This is not a title, this is perhaps a title, nobody but
you know!  This is not a title, this is perhaps a title, nobody but
you know!
\item[TitleAgain:] This is not a title, this is perhaps a title,
nobody but you know!  This is not a title, this is perhaps a title,
nobody but you know!  This is not a title, this is perhaps a title,
nobody but you know!
\end{description}

\end{document}


Did you try aligning the table cells using the p (paragraph) mode? e.g.

\documentclass[11pt,letterpaper]{article}
\usepackage[showframe]{geometry}

\begin{document}
I would like to get the following effect without manually using \&'' and \textbackslash'' to wrap the text (i.e., all the text will be wrapped automatically).
\hspace{1cm}
\begin{table}[!h]
\begin{tabular}{l c p{4in}}
\hline
Title & &Title to the long Text cell\\
\hline
Title&:             &This is not a title, this is perhaps a title, nobody but you know!
This is not a title, this is perhaps a title, nobody but you know!
This is not a title, this is perhaps a title, nobody but you know!\\
TitleAgain&:        &This is not a title, this is perhaps a title, nobody but you know!
This is not a title, this is perhaps a title, nobody but you know!
This is not a title, this is perhaps a title, nobody but you know!\\
\hline
\end{tabular}
\caption{Solution: Text wrapped using the \texttt{p} (paragraph) alignment.}
\end{table}

\end{document}


Do you mean something like this:

\documentclass[11pt,letterpaper]{article}
\usepackage[showframe]{geometry}
% Make lists without bullets and compact spacing
\renewenvironment{itemize}{
\begin{list}{}{
\setlength{\leftmargin}{1.5em}
\setlength{\itemsep}{1pt}
\setlength{\parskip}{0em}
\setlength{\parsep}{0.25em}
}
}{
\end{list}
}

\newcommand{\wrapit}[2]{%
\parbox[t]{2cm}{#1\wrapdelim}%
\hspace*{1em}%
\parbox[t]{\dimexpr \textwidth - \parindent - 2cm - 1em\relax}{#2}%
}
\newcommand*{\wrapdelim}{:}
% note: just as I defined '\wrapdelim', you could define lengths to make maintaining \wrapit more easy to control

\begin{document}

\section*{Main-Section}
\subsection*{Sub-Section}

\begin{itemize}
\item \begin{tabular}{@{}ll}
Title:             &This is not a title, this is perhaps a title, nobody but you know!\\
&This is not a title, this is perhaps a title, nobody but you know!\\
&This is not a title, this is perhaps a title, nobody but you know!\\
TitleAgain:             &This is not a title, this is perhaps a title, nobody but you know!\\
&This is not a title, this is perhaps a title, nobody but you know!\\
&This is not a title, this is perhaps a title, nobody but you know!\\
\end{tabular}
\end{itemize}

I would like to get the following effect without manually using \&'' and \textbackslash'' to wrap the text (i.e., all the text will be wrapped automatically).

%\newpage
\wrapit{Title}{I would like to get the following effect without manually using \&'' and \textbackslash'' to wrap the text (i.e., all the text will be wrapped automatically).}

\wrapit{TitleAgain}{I would like to get the following effect without manually using \&'' and \textbackslash'' to wrap the text (i.e., all the text will be wrapped automatically).}

I would like to get the following effect without manually using \&'' and \textbackslash'' to wrap the text (i.e., all the text will be wrapped automatically).

\end{document}