# Table cell with linebreak text runs into next line

In a tabu table, if I have long enough text in a cell, a linebreak is automatically inserted. This is fine with me and what I want. However the last line of text in that cell is basically bottom aligned with the next \hline, i.e. there is no padding.

Is this expected behavior or a bug? How can I fix it?

Sample code:

\documentclass{scrartcl}
\usepackage{tabu}
\begin{document}
\begin{tabu} to \textwidth {|X|X|X|X|}
\hline
Column 1&Column 2&Column 3&Column 4\\
\hline
some text&some long text some long text some long text some long text &some text&some text\\
\hline
some text&no problem here&some text&some text\\
\hline
\end{tabu}
\end{document}

• For horizontal lines with improved spacing, you might consider using the \toprule, \midrule and \bottomrule commands from the booktabs package. Please keep in mind, that these rules are incompatible with vertical lines. – leandriis Jun 13 '18 at 11:30
• I like the booktabs package. Is it compatible with fixed with tables and automatically adjusted cell width (like in the example) and automatic linebreaks? – user1583209 Jun 13 '18 at 11:33
• Yes, you can use the booktabs package in combination with the table you showed in your question. Simply load the package, replace the \hline commands by the rules I listed in my previous comment and remove all vertical lines. – leandriis Jun 13 '18 at 11:36
• Can booktabs do something like \cline{} , i.e. horizontal lines over certain columns only? – user1583209 Jun 13 '18 at 11:44
• Yes, it can. The command is \cmidrule{1-2} for a line over the first and second column. – leandriis Jun 13 '18 at 11:45

## 1 Answer

like this?

somewhere before tabu table add \tabulinesep=<amount>:

\documentclass{scrartcl}
\usepackage{tabu}
\begin{document}

\tabulinesep = 3pt % <--- added
\begin{tabu} to \textwidth {|X|X|X|X|}
\hline
Column 1&Column 2&Column 3&Column 4\\
\hline
some text&some long text some long text some long text some long text &some text&some text\\
\hline
some text&no problem here&some text&some text\\
\hline
\end{tabu}
\end{document}