2

The basic tabular package seems oriented for short columns, not where text wraps.

What to do when the third column in this case can be multiple lines of text that should wrap?

\begin{tabular} {|c|c|c|}\hline 
 Vendor & Website & Description \\ 
 \hline 
Amazon & \href{amazon.com} & long and windy description goes here \\
Avnet  & \href{avnet.com} & blah blah blah ... \\
\end{tabular}
  • 4
    There is a p{<width>} type column (as opposed to c) that formats as paragraph text. – Steven B. Segletes May 11 '16 at 4:33
3

I use a lot this small column definitions for this kind of things --- I hope they can help (and give hints on how to modify them to your tastes):

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{array, ragged2e}
\newcolumntype{P}[1]{>{}p{#1\linewidth}<{}}
\newcolumntype{R}[1]{>{\RaggedRight\arraybackslash}p{#1\linewidth}<{}}
\newcolumntype{M}[1]{>{\RaggedRight\arraybackslash}m{#1\linewidth}<{}}

\newcommand{\longtext}{This is quite a long test, but not so long
as the text you get with \texttt{lipsum}, just to check things out.}

\begin{document}

\begin{tabular}{|c|c|P{0.3}|}
    \hline
    kind: & \texttt{P}-column & \longtext \\ 
    \hline
\end{tabular}

\begin{tabular}{|c|c|R{0.3}|}
    \hline
    kind: & \texttt{R}-column & \longtext \\ 
    \hline
\end{tabular}

\begin{tabular}{|c|c|M{0.3}|}
    \hline
    kind: & \texttt{M}-column & \longtext \\ 
    \hline
\end{tabular}

Three kind of paragraph blocks

Normally justified text come out badly in small columns; I normally prefer using \raggedright or, better, \RaggedRight for this kind of text.

The \arraybackslash it's here to avoid the infamous Misplaced noalign error...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.