3

I'm trying to create a table which would ideally break across different pages as it is long. However, my table just bleeds across a single page and I'm not sure where I'm making a mistake.

I just started learning LaTeX, would be grateful for any help!

screenshot of table

\documentclass{article} \usepackage{multirow} \usepackage{tabularx} \begin{document} \begin{table} \centering \makebox[\linewidth]{ \begin{tabularx}{500pt}{@{} |p{40pt}|p{50pt}|X|l|X| @{}} \cline{1-5} Category & Solution & Explanations & Citations & Example \\ \cline{1-5} \multirow{3}{*}{} Pricing & Align prices with alternatives & This solution establishes price coherence between the price that the platform charges buyers with what the buyer would pay if interacting with the seller directly. & & Airbnb expects that property owners will post the same price for lodging across all channels. It can monitor this through random checks or offer a low-price guarantee. \\ \cline{2-5} & Reduce commission & The intermediary could lower its percentage commission to reduce the incentive to bypass the platform. & & Airbnb offers lower commissions for hosts who have multiple listings and large volume on the platform.\\ \cline{2-5} & Reduce price & The intermediary could lower the price that it charges buyers in order to decrease the absolute cash value of the buyer’s incentive to bypass the platform. & & Airbnb rooms are typically less than the price of nearby hotel rooms, reducing the appeal of those substitutes. \\ \cline{1-5} \multirow{3}{*}{} Revenue model & Charge before match is made for lead generation & The intermediary collects user fees before performing any functions or services. & & Airbnb could - but currently does not - require that buyers or sellers pay a one-time initiation fee to use the platform.\\ \cline{2-5} & Charge for advertising & The intermediary does not charge a commission to users, and therefore reduces the incentive to disintermediate. & & Airbnb could - but currently does not - eliminate its commission and instead place advertisements inside of its site, similarly to many news sites, like CNN.com\\ \cline{2-5} & Charge a subscription & The intermediary charges for time on the platform (e.g., monthly) regardless of the number of leads, matches, or consummated transactions. & & Airbnb could - but currently does not - require that buyers or sellers pay monthly fees to access the site. This is the approach that Match.com, a popular dating site, employs. \\ \cline{1-5} \multirow{4}{*}{} Policies & Block communication & The intermediary can use technology to disallow buyer and seller from interacting directly. & & Airbnb uses its own closed messaging system to allow buyers and sellers to correspond with one another. This system does not allow buyers or sellers to trade contact information that would enable off-platform communication. \\ \cline{2-5} & Sanction offenders & If disintermediation is evident, the intermediary can reduce the ratings or future service access for buyers or sellers. & & Any buyer or seller caught violating the terms of service faces the following actions: “Suspend or limit your access to or use of the Airbnb platform and/or your account; suspend or remove listings, reviews, or other content; cancel pending or confirmed bookings; or suspend or revoke any special status associated with your account.” \\ \cline{2-5} & Homogenity of service & The intermediary can ensure that each service is identical to every other in experience, quality, and price, which removes the incentive for disintermediation. & & Airbnb sets expectations for the cleanliness of the property. It could - but currently does not - narrow its listing to, for example, only one-bedroom apartments with a kitchen and separate entrance. This would be similar to Uber’s expectation when it first launched its service in San Francisco: Drivers were encouraged to only deploy new Toyota Prius cars. \\ \cline{2-5} & Homogenity of service 2 & The intermediary can ensure that each service is identical to every other in experience, quality, and price, which removes the incentive for disintermediation. & & Airbnb sets expectations for the cleanliness of the property. It could - but currently does not - narrow its listing to, for example, only one-bedroom apartments with a kitchen and separate entrance. This would be similar to Uber’s expectation when it first launched its service in San Francisco: Drivers were encouraged to only deploy new Toyota Prius cars. \\ \cline{2-5} & & & & \\ \cline{1-5} \end{tabularx} } \caption{Sources of disintermediation} \label{table: sources} \end{table} \end{document} 
4
  • Welcome to TeX.SE! Commented Dec 19, 2022 at 16:42
  • If you want page breaks, have a look at the longtable package or at longtblr from the tabularray package Commented Dec 19, 2022 at 16:44
  • 5
    (I'm a bit confused, your title and tags are about xltabular, but your code uses tabularx) Commented Dec 19, 2022 at 16:50
  • 1
    Using \makebox or table would prevent page breaks even, if you'd use xltabular instead of tabularx. So you should remove them. Commented Dec 19, 2022 at 17:00

2 Answers 2

5
  • Any kind of long tables (as are longtable, xltabular, ltablex etc.) should not be encapsulated in float table. It prevent that they can be broken over several pages.
  • Using xltabular, which is combination of longtable and tabularx require (for proper appearance for which it is developed) similar as other "classic" long tables, that be defined firstathed, \head, foot and lastfoot of table. -If you use (relative) new packages tabularay package, based on LaTaX3 project, is sufficient to say how many first table body rows should serve for table headers and last rows for table foots. So I prefer (among other its nice features) to use this package for writing of tables.
  • Aforementioned (and other) tabularray features are paid with longer compilation time (it depends on table complexity).
  • Table, that be looking nice, should be wider than default text block width of article documentclass. Consequently it is sensible to consider to change default table layout by use of the geometry package (see MWE below).

Off topic:
I would redesign your table as follows:

  • almost empty first column with categories will move to row above description of categories as their titles,
  • increase \textwidth of document by use geometry package,
  • for better filing text in cells I would use \small font size,
  • for table would use longtblr of tabularray package,
  • remove all \hline from table body,
  • for rest of table horizontal lines would use rules defined in the booktabs package-

A MWE (Minimal Working example) is:

\documentclass{article} \usepackage[margin=25mm]{geometry} % define page layout \usepackage{microtype} % for better spacing of words in paragraph \usepackage{ragged2e} \usepackage{tabularray} \UseTblrLibrary{booktabs} % for "professional horizontal rules in table \NewTableCommand\category[1][0pt]{% % for shortcut in table body code \SetRow{abovesep+=#1} \SetCell[c=4]{l, font=\small\itshape\bfseries} \SetTblrStyle{contfoot-text}{font=\footnotesize\itshape} } \begin{document} \begin{longtblr}[ caption = {Sources of disintermediation}, label = {table:sources} ]{colsep = 4pt, colspec = {@{} X[1.1, j, cmd=\RaggedRight] X[3,j] X[0.9, j, cmd=\RaggedRight] X[3,j] @{}}, rows = {font=\small}, row{1} = {font=\small\bfseries}, rowsep = 1pt, rowhead = 1, } \toprule Solution & Explanations & Citations & Example \\ \midrule % table body \category Pricing: & & & \\ Align prices with alternatives & This solution establishes price coherence between the price that the platform charges buyers with what the buyer would pay if interacting with the seller directly. & & Airbnb expects that property owners will post the same price for lodging across all channels. It can monitor this through random checks or offer a low-price guarantee. \\ Reduce commission & The intermediary could lower its percentage commission to reduce the incentive to bypass the platform. & & Airbnb offers lower commissions for hosts who have multiple listings and large volume on the platform. \\ Reduce price & The intermediary could lower the price that it charges buyers in order to decrease the absolute cash value of the buyer’s incentive to bypass the platform. & & Airbnb rooms are typically less than the price of nearby hotel rooms, reducing the appeal of those substitutes. \\ \category[5pt] Revenue model: & & & \\ Charge before match is made for lead generation & The intermediary collects user fees before performing any functions or services. & & Airbnb could - but currently does not - require that buyers or sellers pay a one-time initiation fee to use the platform. \\ Charge for advertising & The intermediary does not charge a commission to users, and therefore reduces the incentive to disintermediate. & & Airbnb could - but currently does not - eliminate its commission and instead place advertisements inside of its site, similarly to many news sites, like CNN.com. \\ Charge a subscription & The intermediary charges for time on the platform (e.g., monthly) regardless of the number of leads, matches, or consummated transactions. & & Airbnb could - but currently does not - require that buyers or sellers pay monthly fees to access the site. This is the approach that Match.com, a popular dating site, employs. \\ % \midrule[dashed] \category[5pt] Policies: & & & \\ Block communication & The intermediary can use technology to disallow buyer and seller from interacting directly. & & Airbnb uses its own closed messaging system to allow buyers and sellers to correspond with one another. This system does not allow buyers or sellers to trade contact information that would enable off-platform communication. \\ Sanction offenders & If disintermediation is evident, the intermediary can reduce the ratings or future service access for buyers or sellers. & & Any buyer or seller caught violating the terms of service faces the following actions: “Suspend or limit your access to or use of the Airbnb platform and/or your account; suspend or remove listings, reviews, or other content; cancel pending or confirmed bookings; or suspend or revoke any special status associated with your account.” \\ Homogenity of service & The intermediary can ensure that each service is identical to every other in experience, quality, and price, which removes the incentive for disintermediation. & & Airbnb sets expectations for the cleanliness of the property. It could - but currently does not - narrow its listing to, for example, only one-bedroom apartments with a kitchen and separate entrance. This would be similar to Uber’s expectation when it first launched its service in San Francisco: Drivers were encouraged to only deploy new Toyota Prius cars. \\ Homogenity of service 2 & The intermediary can ensure that each service is identical to every other in experience, quality, and price, which removes the incentive for disintermediation. & & Airbnb sets expectations for the cleanliness of the property. It could - but currently does not - narrow its listing to, for example, only one-bedroom apartments with a kitchen and separate entrance. This would be similar to Uber’s expectation when it first launched its service in San Francisco: Drivers were encouraged to only deploy new Toyota Prius cars. \\ \bottomrule \end{longtblr} \end{document} 

enter image description here

2
  • Thanks so much! I've learnt quite a lot from your code too. I'm not too sure what \category does though and couldn't find much about it online. Is there a package on it where I can find out more? Commented Dec 20, 2022 at 0:36
  • 1
    @NigelS, \category is defined as new command in MWE preamble, which replace content of command, i.e. \instead that you write in table body \SetRow{abovesep+=...}\SetCell[c=4]{l, font=\small\itshape\bfseries} you only write defined command. More about tabularray is in package documentation, about concept of defining new commands you can find for example in tobi.oetiker.ch/lshort/lshort.pdf (page 176) and in overleaf.com/learn/latex/Commands,. Commented Dec 20, 2022 at 2:11
5

You never applied any type of long tables. If you need xltabular for instance, below is an example.

I made a couple of changes: moved title from the bottom to the top, added geometry to increase space for the table, added left alignment to the first and the second column, and added thicker rules with bold font to distinguish headers from regular cells. The new geometry is only applied for the table. However, if you use \usepackage[margin=1.5cm]{geometry} in the preamble instead, the new layout will be applied for the whole document.

Personally, most of the bars and rules in the table are rather distracting. I would consider reducing their number and completely get rid of vertical bars. If you do so, you can also utilise booktabs and its custom rules but the package doesn't work with vertical bars.

enter image description here

\documentclass{article} \usepackage[pass]{geometry} \usepackage{ragged2e} \usepackage{multirow} \usepackage{xltabular} \begin{document} \begingroup \newgeometry{margin=1.5cm} \renewcommand*\arraystretch{1.45} \setlength\extrarowheight{-1pt} \begin{xltabular}{\linewidth}{@{} |>{\RaggedRight}l|>{\RaggedRight}p{50pt}|X|l|X| @{}} \caption{Sources of disintermediation\label{table: sources}} \\ \noalign{\hrule height 0.8pt} \rule[-6pt]{0pt}{18pt}\textbf{Category} & \textbf{Solution} & \textbf{Explanations} & \textbf{Citations} & \textbf{Example} \\ \noalign{\hrule height 0.5pt} \endhead \noalign{\noindent\smash{\vrule height 0.8pt width \linewidth}} \endfoot \multirow{3}{*}{} Pricing & Align prices with alternatives & This solution establishes price coherence between the price that the platform charges buyers with what the buyer would pay if interacting with the seller directly. & & Airbnb expects that property owners will post the same price for lodging across all channels. It can monitor this through random checks or offer a low-price guarantee. \\ \cline{2-5} & Reduce commission & The intermediary could lower its percentage commission to reduce the incentive to bypass the platform. & & Airbnb offers lower commissions for hosts who have multiple listings and large volume on the platform.\\ \cline{2-5} & Reduce price & The intermediary could lower the price that it charges buyers in order to decrease the absolute cash value of the buyer’s incentive to bypass the platform. & & Airbnb rooms are typically less than the price of nearby hotel rooms, reducing the appeal of those substitutes. \\ \hline \multirow{3}{*}{} Revenue model & Charge before match is made for lead generation & The intermediary collects user fees before performing any functions or services. & & Airbnb could - but currently does not - require that buyers or sellers pay a one-time initiation fee to use the platform.\\ \cline{2-5} & Charge for advertising & The intermediary does not charge a commission to users, and therefore reduces the incentive to disintermediate. & & Airbnb could - but currently does not - eliminate its commission and instead place advertisements inside of its site, similarly to many news sites, like CNN.com \\ \cline{2-5} & Charge a subscription & The intermediary charges for time on the platform (e.g., monthly) regardless of the number of leads, matches, or consummated transactions. & & Airbnb could - but currently does not - require that buyers or sellers pay monthly fees to access the site. This is the approach that Match.com, a popular dating site, employs. \\ \hline \multirow{4}{*}{} Policies & Block communication & The intermediary can use technology to disallow buyer and seller from interacting directly. & & Airbnb uses its own closed messaging system to allow buyers and sellers to correspond with one another. This system does not allow buyers or sellers to trade contact information that would enable off-platform communication. \\ \cline{2-5} & Sanction offenders & If disintermediation is evident, the intermediary can reduce the ratings or future service access for buyers or sellers. & & Any buyer or seller caught violating the terms of service faces the following actions: “Suspend or limit your access to or use of the Airbnb platform and/or your account; suspend or remove listings, reviews, or other content; cancel pending or confirmed bookings; or suspend or revoke any special status associated with your account.” \\ \cline{2-5} & Homogenity of service & The intermediary can ensure that each service is identical to every other in experience, quality, and price, which removes the incentive for disintermediation. & & Airbnb sets expectations for the cleanliness of the property. It could - but currently does not - narrow its listing to, for example, only one-bedroom apartments with a kitchen and separate entrance. This would be similar to Uber’s expectation when it first launched its service in San Francisco: Drivers were encouraged to only deploy new Toyota Prius cars. \\ \cline{2-5} & Homogenity of service 2 & The intermediary can ensure that each service is identical to every other in experience, quality, and price, which removes the incentive for disintermediation. & & Airbnb sets expectations for the cleanliness of the property. It could - but currently does not - narrow its listing to, for example, only one-bedroom apartments with a kitchen and separate entrance. This would be similar to Uber’s expectation when it first launched its service in San Francisco: Drivers were encouraged to only deploy new Toyota Prius cars. \\ \end{xltabular} \restoregeometry \endgroup \end{document} 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.