# problem with text wrapping in tabular environment

I would like the contents of a cell in a row span several lines. I have the following MWE:

\begin{table}[b]{
\begin{center}{
\begin{tabular}{|l|c|c|c|c|}
\hline
Source & Value & Affected & Type & Effect on the    \\
&       & sample   &      & total yield \\
\hline
\hline
Statistical  & 2-14\% & bkg. & bin-by-bin & - \\
Uncertainties in C(i, j) & & & &\\
\hline
Extrapolation & 2-22\% & bkg. & bin-by-bin & - \\
Uncertainties in C(i, j) & & & & \\
\hline
Integrated Luminosity & 2.6\% & signal & norm. & 2.6\%\\
\hline
Muon ID and trigger    & 2\% per muon  & signal & norm. & 4\% \\
efficiency             &               &        &       &     \\
\hline
Track selection and    & 5\% per track & signal & norm. & 10\% \\
isolation efficiency   &               &        &       &     \\
\hline
MC statistical & 2-100\%        & signal   & bin-by-bin & 4-6\%  \\
uncertainties           &               &        &       &   \\
\hline
\end{tabular}
\caption{List of systematics uncertainties and their effect on estimates of the
QCD multijet background and signal.}
\label{tab:systematics}
}
\end{center}
}
\end{table}


In order to achieve that I had to create a new row with other entries in that row empty. As a result the values do not get centered. I tried to implement text wrapping according to the solution provided in: Solution

Since I'm using some cls files to write my thesis, it is messing up this solution. The required files are in my dropbox: Support files

You can do that with the makecell package, which allows for line breaks in cells and a common formatting, through the\thead and \makecell commands.

I propose another, looking better, solution, with only horozontal rules of different thickness, with the booktabs package.

Finally I added some improvements to your table (unbreakable thin space between number and %, endash for ranges of numbers and emdash for empty cells).

\documentclass{ucr}
\usepackage{makecell, booktabs, array}

\begin{document}

\begin{table}[b]
\centering
\renewcommand\cellalign{lc}
\begin{tabular}{|l|c|c|c|c|}
\hline
\hline
\hline
\makecell{Statistical         \\[-1ex]Uncertainties in C(i, j)} & 2--14\,\% & bkg. & bin-by-bin & --- \\
\hline
\makecell{Extrapolation       \\[-1ex]Uncertainties in C(i, j)} & 2--22\,\% & bkg. & bin-by-bin & --- \\
\hline
Integrated Luminosity         \\
\hline
\makecell{Muon ID and trigger \\[-1ex]efficiency} & 2\,\% per muon & signal & norm. & 4\,\% \\
\hline
\makecell{Track selection and \\[-1ex]isolation efficiency }& 5\,\% per track & signal & norm. & 10\,\% \\
\hline
\makecell{MC statistical      \\[-1ex]uncertainties} & 2--100\,\% & signal & bin-by-bin & 4--6\,\% \\
\hline
\end{tabular}
\caption{List of systematics uncertainties and their effect on estimates of the
QCD multijet background and signal.}
\label{tab:systematics}
\end{table}
\begin{table}[b]
\centering
\renewcommand\cellalign{lc}
\begin{tabular}{lcccc}
\toprule
\cmidrule(lr){1-5}
\morecmidrules
\cmidrule(lr){1-5}
\makecell{Statistical \\[-1ex]Uncertainties in C(i, j)} & 2--14\,\% & bkg. & bin-by-bin & --- \\
\makecell{Extrapolation       \\[-1ex]%
Uncertainties in C(i, j)} & 2--22\,\% & bkg. & bin-by-bin & --- \\
Integrated Luminosity         \\
\makecell{Muon ID and trigger \\[-1ex]efficiency} & 2\,\% per muon & signal & norm. & 4\,\% \\
\makecell{Track selection and \\[-1ex]isolation efficiency }& 5\,\% per track & signal & norm. & 10\,\% \\

• That probably depends on some parameter values in your preamble. You can change the value of [0.5ex] in multiline cells to a greater value. For me, [-1ex] that I first tested was too much. Change it ad libitum. – Bernard May 19 '16 at 1:47
• Let me add I initially tried to change the value of \linespread for these cells (globally) to have a simpler code, but it doesn't work, probably due to the class file. – Bernard May 19 '16 at 1:51