TransWikia.com

Tabularx adding rows makes table disappear and wrong margin

TeX - LaTeX Asked on May 29, 2021

I am using tabularx to create a simple two column table with long text. First column should be about 1/3 of the width and the second column should occupy the rest of the width.

I am having two issues:

  • The table is created in the output but if I add more than a certain amount of text (I guess depending on the height?) the table disappears and only the caption is left. It should still fit in the page I would guess. It is also not an issue with certain rows. I tried different combinations and if I comment out enough rows it will work.

  • The right vertical line is not aligned with the box of the table.

table with 3 rows commented out

begin{table}[ht]
  label{tab:capitalism}
  caption{The grammar of the project-oriented justificatory regime~autocite[123]{capitalism}.}
    begin{tabularx}{linewidth}{|>{hsize=.35hsize}X|X|}
      hline
      multicolumn{2}{|X|}{Seventh justificatory regime} tabularnewline hline
       Equivalency principle (genereal standard) & Activity; project initiation; remote links between people tabularnewline hline
       A state of smallness & Inability to get involved, to trust in others, to communicate; close-mindedness, prejudice, authoritarianism, intolerance, stability, overreliance on one's roots, rigidity, etc. tabularnewline hline
       A state of greatness & Adaptability, flexibility, polyvalence; sincerity in face-to-face encounters; ability to spread the benefits of social connections, to generate enthusiasm and to increase teammates' employability tabularnewline hline
       Directory of subjects & Managers, coaches, innovators  tabularnewline hline
       Directory of objects & Computer and information technologies; New organisational devices (sub-contracting, flexibility, outsourcing, autonomous units, franchises, etc.) tabularnewline hline
       Natural relationships & Trusting and being trustworthy; ability to communicate; adaptability to others' needs tabularnewline hline
       Greatness ratio & `Great' persons enhance `small' person' employability in return for their trust and enthusiasm for project work, i.e., their ability to take part in another project tabularnewline hline
       %Format of investment & Ready to sacrifice all that could curtail one's availability, giving up lifelong plans  tabularnewline hline
       %Standard (paradigmic) test & Ability to move from one project to another  tabularnewline hline
       %Harmonious figure of natural order & Where the world's natural form resembles that of a network hline
  end{tabularx}
end{table}

One Answer

The following MWE shows how you could minimize the amount of wasted white space in your table while keeping the width of the first column roughly at 1/3 of the total width. If you prefer the approach using two X type columns, make sure that the values of hsize add up to 2. Alternatively, you could also use a p type column for the first column and let latex calculate the required width of the second column, which should be easier than the approach using two X type columns.

documentclass{article}
usepackage{tabularx}
usepackage{biblatex}
usepackage[english]{babel}
usepackage{calc}
usepackage{ragged2e}
begin{document}

begin{table}
  label{tab:capitalism}
  caption{The grammar of the project-oriented justificatory regime~autocite[123]{capitalism}.}
begin{tabularx}{linewidth}{|>{RaggedRightarraybackslash}p{widthof{Equivalency principle}}|X|}
%begin{tabularx}{linewidth}{|>{hsize=.66hsizeraggedrightarraybackslash}X|>{hsize=1.34hsize}X|}
%begin{tabularx}{linewidth}{|>{raggedrightarraybackslash}p{0.33textwidth}|X|}
      hline
      multicolumn{2}{|l|}{Seventh justificatory regime} tabularnewline hline
       Equivalency principle (genereal standard) & Activity; project initiation; remote links between people tabularnewline hline
       A state of smallness & Inability to get involved, to trust in others, to communicate; close-mindedness, prejudice, authoritarianism, intolerance, stability, overreliance on one's roots, rigidity, etc. tabularnewline hline
       A state of greatness & Adaptability, flexibility, polyvalence; sincerity in face-to-face encounters; ability to spread the benefits of social connections, to generate enthusiasm and to increase teammates' employability tabularnewline hline
       Directory of subjects & Managers, coaches, innovators  tabularnewline hline
       Directory of objects & Computer and information technologies; New organisational devices (sub-contracting, flexibility, outsourcing, autonomous units, franchises, etc.) tabularnewline hline
       Natural relationships & Trusting and being trustworthy; ability to communicate; adaptability to others' needs tabularnewline hline
       Greatness ratio & `Great' persons enhance `small' person' employability in return for their trust and enthusiasm for project work, i.e., their ability to take part in another project tabularnewline hline
       Format of investment & Ready to sacrifice all that could curtail one's availability, giving up lifelong plans  tabularnewline hline
       Standard (paradigmic) test & Ability to move from one project to another  tabularnewline hline
       Harmonious figure of natural order & Where the world's natural form resembles that of a network tabularnewline hline
  end{tabularx}
end{table}

end{document}

Answered by leandriis on May 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP