0

I am trying to put a table in the normal text flow. What I mean is that I have plain text and then a table with a couple of columns and rows. If the table is small, like i.e. 30% of the A4 page, then the table appears as expected directly after the text, but if the table gets bigger i.e. 70% of the A4 page, the table is moved to next page of the resulting PDF document. How can I force the table to remain within the text flow? Also, how can I tell the table to break vertically when it is bigger than one A4 page? I guess I have to tell the table segment to stay within the text flow similar to setting the h in figure like \begin{figure}[h]. Is that possible with tables?

My code segment looks like this:

\subsection{Comparison of the different projects}
    The following table summarizes the different Projects mentioned within the related research section:

    \begin{table}
        \caption{Comparison of Project One, Project Two, and Project Three}
        \newcolumntype{a}{>{\raggedright}p{3.8cm}}
        \newcolumntype{b}{>{\raggedright}p{3cm}}
        \begin{tabularx}{\linewidth}{|Z|a|b|Y|}
            \hline
            \textbf{Name} & \textbf{Goal} & \textbf{Project phase} & \textbf{LSP ability} \\
            \hline
            Project One   & Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah. & Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah. & Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah. \\
            \hline
            Project Two   & Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah. & Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah. & Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah. \\
            \hline
            Project Three & Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah. & Blah Blah Blah Blah Blah Blah Blah Blah Blah. & Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah. \\
            \hline
        \end{tabularx}
    \end{table}
Socrates
  • 423
  • 1
    I think you want https://tex.stackexchange.com/questions/39017/how-to-influence-the-position-of-float-environments-like-figure-and-table-in-lat – Au101 Aug 19 '18 at 21:40
  • 2
    Also the longtable package is usually the way to go for tables that break across pages – Au101 Aug 19 '18 at 21:42
  • @Au101 How can I set the column width when using longtable? – Socrates Aug 19 '18 at 22:52
  • @Au101 Ok, just found it right after asking here! Setting size with p{3.8cm} in the params now: \begin{longtable}[c]{| c | p{3.8cm} | p{3cm} | p{3.6cm} |} – Socrates Aug 19 '18 at 22:56
  • 2
    You also have the ltablex package, which brings the functionalities of longtable to tabularx – Bernard Aug 19 '18 at 23:16
  • You should always have a plan B in case it won't fit where you want it to go. – John Kormylo Aug 20 '18 at 03:51

0 Answers0