# Wrapping a table both rowwise and pagewise

I just discovered the tabularx package which allows me to introduce a table column which has line wrapping, and I also know that packages that allow automatic table splitting across pages do exists (e.g. longtable).

The problem is that I need both features at once, and nesting two commands provided by two different packages doesn't work (e.g. longtable + tabularx).

I would prefer a solution which uses tabularx + some other package if necessary to achieve this. Otherwise, any solution is acceptable which allows me to do automatic table splitting across pages and long line wrapping on the same table.

-
lockstep has given an answer for combining tabularx and longtable, but your wording makes me check that you do realise that standard latex tables allow line wrapping if you use a p column? (tabularx just saves you from specifying the column width) similarly you can use p columns in longtable without any additional packages. – David Carlisle Apr 28 '12 at 21:06

Have a look at the ltxtable package. From the package description:

Ltxtable provides the functionality of longtable and tabularx together inside a longtable environment. The code of each such environment (with X specifiers in its column layout) should be in a separate file, which is then included in your document by a command \LTXtable{<width>}{<file name>}

-

You can use feature rich tabu package that has a longtabu option which combines tabularx and longtable. Here is a MWE:

\documentclass{article}
\usepackage{tabu}
\usepackage{longtable} %tabu needs this to be loaded.
\usepackage{lipsum} % provides dummy text.
\usepackage[charter]{mathdesign} % just for some good font...(personal taste)
\usepackage[margin=1in,showframe]{geometry}% to adjust page margins etc and to show frame.
%==================================================================
\begin{document}
% ----------------------------------------------------------------------%
\begin{longtabu} to \textwidth {|X[1 , p ] |X[1 , l ] | X[1 , c ]| X[1 , r ]|}\firsthline\hline
%
%
\multicolumn{4}{c}%
{{\bfseries  Continued from previous page}} \\
\hline
%
%
\hline \multicolumn{4}{|r|}{{Continued on next page}} \\ \hline
\endfoot
%
\hline
\multicolumn{4}{|r|}{{Concluded}} \\ \hline
\endlastfoot
%--------------------------table body starts-------------------
\lipsum[4]& \lipsum[4]& \lipsum[4] & \lipsum[4] \\\hline
\lipsum[4]& \lipsum[4]& \lipsum[4] & \lipsum[4]\\hline
\lipsum[4] &\lipsum[4]& \lipsum[4] & \lipsum[4]\\\lasthline
%--------------------------table body ends-------------------
\end{longtabu}
%===============================================================
\end{document}


-