Context
I'm using the tablestyles package to build nice tables for rendering database schema and tables.
Issue
But I'm not able to figure out a way to nicely break a table when it is longer than an A4 page (fig.1).
There is no mention of longtable in the tablestyles documentation, but it relies on the tabular environment or the tabularx package, it this helps.
Fig.1: Table doesn't break at the end of the page. Rendered using TexMaker 5.0.2 on Ubuntu 18.04.
MRE
Here is a piece of code, feel free to duplicate one row N-time with a great N value (e.g. 100):
\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{
left=2cm,
right=1.6cm,
top=2cm,
bottom=2cm,
footskip=30pt
}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[table,dvipsnames]{xcolor}
\usepackage{float}
\usepackage{tabularx}
\usepackage{tablestyles}
\renewcommand{\arraystretch}{1.1}
\usepackage{longtable}
\usepackage{booktabs}
%\usepackage{makecell} % buggy
%%%%%%%%%%%%%%%%
\begin{document}
%%%%%%%%%%%%%%%%
\begin{table}[H]
\tablestyle[sansboldbw]
\centering
\caption{The long table.}
%\begin{tabular}{*{4}{p{0.24\textwidth}}} % nope, this doesn't adapt to the columns' content
%\begin{tabular*}{\columnwidth}{@{\extracolsep{\stretch{1}}}*{4}{l}@{}} % buggy
% You can replace \begin{tabular} by \begin{longtable}
\begin{tabular}{p{0.29\linewidth}p{0.24\linewidth}p{0.22\linewidth}p{0.18\linewidth}}
\theadstart
\thead Column\_category &
\thead Type &
\thead Information1 &
\thead Information2 \\
\tbody
Quisque laoreet ultricies fringilla. & Lorem ipsum dolor sit amet & Pellentesque accumsan & Morbi nec est lacus \\
Quisque laoreet ultricies fringilla. & Lorem ipsum dolor sit amet & Pellentesque accumsan & Morbi nec est lacus \\
\tend
% You can replace \end{tabular} by \end{longtable}
\end{tabular}
\end{table}
\end{document}
Replacing \begin{tabular} and \end{tabular} by \begin{longtable} and \end{longtable} has no effect.
Helpful threads
Which tabular packages do which tasks and which packages conflict?
How to convert table to longtable being able to break across pages?
tabularwithlongtable: Alongtableenvironment can not be used inside of atableenvironment sinctabledoes not suppprt page breaks. – leandriis May 15 '20 at 10:27longtablewith a\caption. In that case, place the\captionafter\begin{longtable}and add a\\after the\caption. – leandriis May 15 '20 at 10:34