Prevent table from going off page, how?












3















How can I prevent this table from going off the page please?
I need solution for both vertical overflowing and horizontal overflowing




  1. For horizontal, it exceeds the page on the right side. How to limit and scale it so that it fit the page width. See MWE 1

  2. For vertical, the table does not break and continue of the next page. It just stops at the very bottom of the first page and is incomplete. See MWE 2

  3. MWE 3 has both types of overflow. Basically, I want to scale the table to linewidth, and let it continue on next page.


Thank you in advance



Here is my MWE 1 for horizontal overflowing



 documentclass{article}

begin{document}

begin{table}
centering
caption{Relationship of the lesson with the ARCS model}
begin{tabular}{|l|l|}
hline
textbf{Attention} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Relevance} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Confidence} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Satisfaction} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
end{tabular}
end{table}
end{document}


Here is my MWE 2 for vertical overflowing



documentclass{article}

begin{document}

begin{table}
centering
begin{tabular}{|p{3cm}|p{8cm}|}
hline
Test 1 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 2 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 3 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 4 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 5 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 6 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 7 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
end{tabular}
end{table}
end{document}


MWE 3 needing horizontal scaling and flow to next page



documentclass{article}
usepackage{multirow}

begin{document}

begin{table}
centering
begin{tabular}{|l|l|l|l|}
hline
multirow{3}{*}{Suspendisse maximus} & Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
hline
multirow{3}{*}{Suspendisse maximus} & feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
hline
multirow{9}{*}{Suspendisse maximus} & multirow{3}{*}{Mauris~} & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis, \turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. \Donec vel mi quam. Phasellus tincidunt quam in nisl elementum \porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & venenatis~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{2-4}
& multirow{3}{*}{feugiat~} & venenatis~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{2-4}
& multirow{3}{*}{Mauris~} & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
hline
Suspendisse maximus & habitasse~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
& & multicolumn{2}{l|}{begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular}} \
hline
end{tabular}
end{table}
end{document}









share|improve this question

























  • What do you want to do with the text? Do you want to have a line break, in what section of the text?

    – manooooh
    Mar 21 at 10:08











  • When adding an example you should add enough code to make it compilable

    – Raven
    Mar 21 at 10:25











  • Updated the MWE. Thanks

    – Nadeem Muhammad
    Mar 21 at 12:28
















3















How can I prevent this table from going off the page please?
I need solution for both vertical overflowing and horizontal overflowing




  1. For horizontal, it exceeds the page on the right side. How to limit and scale it so that it fit the page width. See MWE 1

  2. For vertical, the table does not break and continue of the next page. It just stops at the very bottom of the first page and is incomplete. See MWE 2

  3. MWE 3 has both types of overflow. Basically, I want to scale the table to linewidth, and let it continue on next page.


Thank you in advance



Here is my MWE 1 for horizontal overflowing



 documentclass{article}

begin{document}

begin{table}
centering
caption{Relationship of the lesson with the ARCS model}
begin{tabular}{|l|l|}
hline
textbf{Attention} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Relevance} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Confidence} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Satisfaction} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
end{tabular}
end{table}
end{document}


Here is my MWE 2 for vertical overflowing



documentclass{article}

begin{document}

begin{table}
centering
begin{tabular}{|p{3cm}|p{8cm}|}
hline
Test 1 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 2 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 3 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 4 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 5 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 6 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 7 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
end{tabular}
end{table}
end{document}


MWE 3 needing horizontal scaling and flow to next page



documentclass{article}
usepackage{multirow}

begin{document}

begin{table}
centering
begin{tabular}{|l|l|l|l|}
hline
multirow{3}{*}{Suspendisse maximus} & Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
hline
multirow{3}{*}{Suspendisse maximus} & feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
hline
multirow{9}{*}{Suspendisse maximus} & multirow{3}{*}{Mauris~} & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis, \turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. \Donec vel mi quam. Phasellus tincidunt quam in nisl elementum \porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & venenatis~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{2-4}
& multirow{3}{*}{feugiat~} & venenatis~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{2-4}
& multirow{3}{*}{Mauris~} & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
hline
Suspendisse maximus & habitasse~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
& & multicolumn{2}{l|}{begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular}} \
hline
end{tabular}
end{table}
end{document}









share|improve this question

























  • What do you want to do with the text? Do you want to have a line break, in what section of the text?

    – manooooh
    Mar 21 at 10:08











  • When adding an example you should add enough code to make it compilable

    – Raven
    Mar 21 at 10:25











  • Updated the MWE. Thanks

    – Nadeem Muhammad
    Mar 21 at 12:28














3












3








3








How can I prevent this table from going off the page please?
I need solution for both vertical overflowing and horizontal overflowing




  1. For horizontal, it exceeds the page on the right side. How to limit and scale it so that it fit the page width. See MWE 1

  2. For vertical, the table does not break and continue of the next page. It just stops at the very bottom of the first page and is incomplete. See MWE 2

  3. MWE 3 has both types of overflow. Basically, I want to scale the table to linewidth, and let it continue on next page.


Thank you in advance



Here is my MWE 1 for horizontal overflowing



 documentclass{article}

begin{document}

begin{table}
centering
caption{Relationship of the lesson with the ARCS model}
begin{tabular}{|l|l|}
hline
textbf{Attention} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Relevance} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Confidence} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Satisfaction} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
end{tabular}
end{table}
end{document}


Here is my MWE 2 for vertical overflowing



documentclass{article}

begin{document}

begin{table}
centering
begin{tabular}{|p{3cm}|p{8cm}|}
hline
Test 1 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 2 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 3 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 4 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 5 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 6 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 7 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
end{tabular}
end{table}
end{document}


MWE 3 needing horizontal scaling and flow to next page



documentclass{article}
usepackage{multirow}

begin{document}

begin{table}
centering
begin{tabular}{|l|l|l|l|}
hline
multirow{3}{*}{Suspendisse maximus} & Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
hline
multirow{3}{*}{Suspendisse maximus} & feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
hline
multirow{9}{*}{Suspendisse maximus} & multirow{3}{*}{Mauris~} & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis, \turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. \Donec vel mi quam. Phasellus tincidunt quam in nisl elementum \porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & venenatis~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{2-4}
& multirow{3}{*}{feugiat~} & venenatis~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{2-4}
& multirow{3}{*}{Mauris~} & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
hline
Suspendisse maximus & habitasse~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
& & multicolumn{2}{l|}{begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular}} \
hline
end{tabular}
end{table}
end{document}









share|improve this question
















How can I prevent this table from going off the page please?
I need solution for both vertical overflowing and horizontal overflowing




  1. For horizontal, it exceeds the page on the right side. How to limit and scale it so that it fit the page width. See MWE 1

  2. For vertical, the table does not break and continue of the next page. It just stops at the very bottom of the first page and is incomplete. See MWE 2

  3. MWE 3 has both types of overflow. Basically, I want to scale the table to linewidth, and let it continue on next page.


Thank you in advance



Here is my MWE 1 for horizontal overflowing



 documentclass{article}

begin{document}

begin{table}
centering
caption{Relationship of the lesson with the ARCS model}
begin{tabular}{|l|l|}
hline
textbf{Attention} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Relevance} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Confidence} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Satisfaction} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
end{tabular}
end{table}
end{document}


Here is my MWE 2 for vertical overflowing



documentclass{article}

begin{document}

begin{table}
centering
begin{tabular}{|p{3cm}|p{8cm}|}
hline
Test 1 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 2 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 3 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 4 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 5 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 6 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
Test 7 & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. Suspendisse maximus nunc quis arcu auctor, a auctor nunc faucibus. Quisque id lorem ut mauris imperdiet facilisis. Ut interdum, mauris vitae molestie venenatis, turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. Donec vel mi quam. Phasellus tincidunt quam in nisl elementum porta. Mauris a augue nisl. Proin viverra feugiat augue, nec. \
hline
end{tabular}
end{table}
end{document}


MWE 3 needing horizontal scaling and flow to next page



documentclass{article}
usepackage{multirow}

begin{document}

begin{table}
centering
begin{tabular}{|l|l|l|l|}
hline
multirow{3}{*}{Suspendisse maximus} & Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
hline
multirow{3}{*}{Suspendisse maximus} & feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& feugiat~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
cline{2-4}
& Mauris~ & multicolumn{2}{l|}{Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.} \
hline
multirow{9}{*}{Suspendisse maximus} & multirow{3}{*}{Mauris~} & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis, \turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor. \Donec vel mi quam. Phasellus tincidunt quam in nisl elementum \porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & venenatis~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{2-4}
& multirow{3}{*}{feugiat~} & venenatis~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{2-4}
& multirow{3}{*}{Mauris~} & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & habitasse~ & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
cline{3-4}
& & dictumst & begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular} \
hline
Suspendisse maximus & habitasse~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
Suspendisse maximus & habitasse~ ~ ~ & multicolumn{2}{l|}{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus.~ ~ ~} \
hline
& & multicolumn{2}{l|}{begin{tabular}[c]{@{}l@{}}begin{tabular}{@{labelitemihspace{dimexprlabelsep+0.5tabcolsep}}l}Ut interdum, mauris vitae molestie venenatis,\turpis turpis varius felis, eget imperdiet leo nulla laoreet tortor.\Donec vel mi quam. Phasellus tincidunt quam in nisl elementum\porta. Mauris a augue nisl. Proin viverra feugiat~ ~end{tabular}end{tabular}} \
hline
end{tabular}
end{table}
end{document}






tables






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 21 at 15:03







Nadeem Muhammad

















asked Mar 21 at 10:06









Nadeem MuhammadNadeem Muhammad

505




505













  • What do you want to do with the text? Do you want to have a line break, in what section of the text?

    – manooooh
    Mar 21 at 10:08











  • When adding an example you should add enough code to make it compilable

    – Raven
    Mar 21 at 10:25











  • Updated the MWE. Thanks

    – Nadeem Muhammad
    Mar 21 at 12:28



















  • What do you want to do with the text? Do you want to have a line break, in what section of the text?

    – manooooh
    Mar 21 at 10:08











  • When adding an example you should add enough code to make it compilable

    – Raven
    Mar 21 at 10:25











  • Updated the MWE. Thanks

    – Nadeem Muhammad
    Mar 21 at 12:28

















What do you want to do with the text? Do you want to have a line break, in what section of the text?

– manooooh
Mar 21 at 10:08





What do you want to do with the text? Do you want to have a line break, in what section of the text?

– manooooh
Mar 21 at 10:08













When adding an example you should add enough code to make it compilable

– Raven
Mar 21 at 10:25





When adding an example you should add enough code to make it compilable

– Raven
Mar 21 at 10:25













Updated the MWE. Thanks

– Nadeem Muhammad
Mar 21 at 12:28





Updated the MWE. Thanks

– Nadeem Muhammad
Mar 21 at 12:28










2 Answers
2






active

oldest

votes


















3














Assuming that by "going off the page" you mean overflowing the page margin instead of adding a line break, you can fix the problem by using the p (Paragraph) column type that takes a width argument:



documentclass{article}

begin{document}
begin{table}
centering
caption{Relationship of the lesson with the ARCS model}
begin{tabular}{|p{3cm}|p{8cm}|}
hline
textbf{Attention} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Relevance} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Confidence} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
textbf{Satisfaction} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
hline
end{tabular}
end{table}
end{document}


enter image description here






share|improve this answer


























  • This works. Thanks. Now how do I center the Attention, Relevance etc. in the middle of the cell?

    – Nadeem Muhammad
    Mar 21 at 14:11











  • I have added another question concerning vertical overflow, can you help ?

    – Nadeem Muhammad
    Mar 21 at 14:32











  • @NadeemMuhammad: If you want your table to automatically be continued on a second page, you will need the longtable package.

    – leandriis
    Mar 21 at 14:43






  • 1





    @NadeemMuhammad it is really bad practice to edit your question to include new questions after an answer has been made that covers the original question. In the future, please create a new question for that. Apart from that leandriis is right: If you want your table to continue on another page you need a longtable. For centering you can add newcolumntype{P}[1]{>{centeringarraybackslash}p{#1}} after also having usepackage{array} and then use the Pcolumn type instead of the p one

    – Raven
    Mar 21 at 16:41






  • 1





    i took liberty and add picture of table generated by suggested solution.

    – Zarko
    Mar 21 at 17:17



















3














i would use tabularx table environment:



documentclass{article}
usepackage{tabularx}

%---------------- show page layout. don't use in a real document!
usepackage{showframe}
renewcommandShowFrameLinethickness{0.15pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%

begin{document}
begin{table}
centering
caption{Relationship of the lesson with the ARCS model}
begin{tabularx}{linewidth}{|>{bfseries}l|X|}
hline
Attention & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
hline
Relevance & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
hline
Confidence & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
hline
Satisfaction & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
hline
end{tabularx}
end{table}
end{document}


which gives



enter image description here



(red lines indicate text borders).






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480652%2fprevent-table-from-going-off-page-how%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Assuming that by "going off the page" you mean overflowing the page margin instead of adding a line break, you can fix the problem by using the p (Paragraph) column type that takes a width argument:



    documentclass{article}

    begin{document}
    begin{table}
    centering
    caption{Relationship of the lesson with the ARCS model}
    begin{tabular}{|p{3cm}|p{8cm}|}
    hline
    textbf{Attention} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Relevance} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Confidence} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Satisfaction} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    end{tabular}
    end{table}
    end{document}


    enter image description here






    share|improve this answer


























    • This works. Thanks. Now how do I center the Attention, Relevance etc. in the middle of the cell?

      – Nadeem Muhammad
      Mar 21 at 14:11











    • I have added another question concerning vertical overflow, can you help ?

      – Nadeem Muhammad
      Mar 21 at 14:32











    • @NadeemMuhammad: If you want your table to automatically be continued on a second page, you will need the longtable package.

      – leandriis
      Mar 21 at 14:43






    • 1





      @NadeemMuhammad it is really bad practice to edit your question to include new questions after an answer has been made that covers the original question. In the future, please create a new question for that. Apart from that leandriis is right: If you want your table to continue on another page you need a longtable. For centering you can add newcolumntype{P}[1]{>{centeringarraybackslash}p{#1}} after also having usepackage{array} and then use the Pcolumn type instead of the p one

      – Raven
      Mar 21 at 16:41






    • 1





      i took liberty and add picture of table generated by suggested solution.

      – Zarko
      Mar 21 at 17:17
















    3














    Assuming that by "going off the page" you mean overflowing the page margin instead of adding a line break, you can fix the problem by using the p (Paragraph) column type that takes a width argument:



    documentclass{article}

    begin{document}
    begin{table}
    centering
    caption{Relationship of the lesson with the ARCS model}
    begin{tabular}{|p{3cm}|p{8cm}|}
    hline
    textbf{Attention} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Relevance} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Confidence} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Satisfaction} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    end{tabular}
    end{table}
    end{document}


    enter image description here






    share|improve this answer


























    • This works. Thanks. Now how do I center the Attention, Relevance etc. in the middle of the cell?

      – Nadeem Muhammad
      Mar 21 at 14:11











    • I have added another question concerning vertical overflow, can you help ?

      – Nadeem Muhammad
      Mar 21 at 14:32











    • @NadeemMuhammad: If you want your table to automatically be continued on a second page, you will need the longtable package.

      – leandriis
      Mar 21 at 14:43






    • 1





      @NadeemMuhammad it is really bad practice to edit your question to include new questions after an answer has been made that covers the original question. In the future, please create a new question for that. Apart from that leandriis is right: If you want your table to continue on another page you need a longtable. For centering you can add newcolumntype{P}[1]{>{centeringarraybackslash}p{#1}} after also having usepackage{array} and then use the Pcolumn type instead of the p one

      – Raven
      Mar 21 at 16:41






    • 1





      i took liberty and add picture of table generated by suggested solution.

      – Zarko
      Mar 21 at 17:17














    3












    3








    3







    Assuming that by "going off the page" you mean overflowing the page margin instead of adding a line break, you can fix the problem by using the p (Paragraph) column type that takes a width argument:



    documentclass{article}

    begin{document}
    begin{table}
    centering
    caption{Relationship of the lesson with the ARCS model}
    begin{tabular}{|p{3cm}|p{8cm}|}
    hline
    textbf{Attention} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Relevance} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Confidence} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Satisfaction} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    end{tabular}
    end{table}
    end{document}


    enter image description here






    share|improve this answer















    Assuming that by "going off the page" you mean overflowing the page margin instead of adding a line break, you can fix the problem by using the p (Paragraph) column type that takes a width argument:



    documentclass{article}

    begin{document}
    begin{table}
    centering
    caption{Relationship of the lesson with the ARCS model}
    begin{tabular}{|p{3cm}|p{8cm}|}
    hline
    textbf{Attention} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Relevance} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Confidence} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    textbf{Satisfaction} & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra.~ \
    hline
    end{tabular}
    end{table}
    end{document}


    enter image description here







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 21 at 17:15









    Zarko

    127k868167




    127k868167










    answered Mar 21 at 10:27









    RavenRaven

    1,139114




    1,139114













    • This works. Thanks. Now how do I center the Attention, Relevance etc. in the middle of the cell?

      – Nadeem Muhammad
      Mar 21 at 14:11











    • I have added another question concerning vertical overflow, can you help ?

      – Nadeem Muhammad
      Mar 21 at 14:32











    • @NadeemMuhammad: If you want your table to automatically be continued on a second page, you will need the longtable package.

      – leandriis
      Mar 21 at 14:43






    • 1





      @NadeemMuhammad it is really bad practice to edit your question to include new questions after an answer has been made that covers the original question. In the future, please create a new question for that. Apart from that leandriis is right: If you want your table to continue on another page you need a longtable. For centering you can add newcolumntype{P}[1]{>{centeringarraybackslash}p{#1}} after also having usepackage{array} and then use the Pcolumn type instead of the p one

      – Raven
      Mar 21 at 16:41






    • 1





      i took liberty and add picture of table generated by suggested solution.

      – Zarko
      Mar 21 at 17:17



















    • This works. Thanks. Now how do I center the Attention, Relevance etc. in the middle of the cell?

      – Nadeem Muhammad
      Mar 21 at 14:11











    • I have added another question concerning vertical overflow, can you help ?

      – Nadeem Muhammad
      Mar 21 at 14:32











    • @NadeemMuhammad: If you want your table to automatically be continued on a second page, you will need the longtable package.

      – leandriis
      Mar 21 at 14:43






    • 1





      @NadeemMuhammad it is really bad practice to edit your question to include new questions after an answer has been made that covers the original question. In the future, please create a new question for that. Apart from that leandriis is right: If you want your table to continue on another page you need a longtable. For centering you can add newcolumntype{P}[1]{>{centeringarraybackslash}p{#1}} after also having usepackage{array} and then use the Pcolumn type instead of the p one

      – Raven
      Mar 21 at 16:41






    • 1





      i took liberty and add picture of table generated by suggested solution.

      – Zarko
      Mar 21 at 17:17

















    This works. Thanks. Now how do I center the Attention, Relevance etc. in the middle of the cell?

    – Nadeem Muhammad
    Mar 21 at 14:11





    This works. Thanks. Now how do I center the Attention, Relevance etc. in the middle of the cell?

    – Nadeem Muhammad
    Mar 21 at 14:11













    I have added another question concerning vertical overflow, can you help ?

    – Nadeem Muhammad
    Mar 21 at 14:32





    I have added another question concerning vertical overflow, can you help ?

    – Nadeem Muhammad
    Mar 21 at 14:32













    @NadeemMuhammad: If you want your table to automatically be continued on a second page, you will need the longtable package.

    – leandriis
    Mar 21 at 14:43





    @NadeemMuhammad: If you want your table to automatically be continued on a second page, you will need the longtable package.

    – leandriis
    Mar 21 at 14:43




    1




    1





    @NadeemMuhammad it is really bad practice to edit your question to include new questions after an answer has been made that covers the original question. In the future, please create a new question for that. Apart from that leandriis is right: If you want your table to continue on another page you need a longtable. For centering you can add newcolumntype{P}[1]{>{centeringarraybackslash}p{#1}} after also having usepackage{array} and then use the Pcolumn type instead of the p one

    – Raven
    Mar 21 at 16:41





    @NadeemMuhammad it is really bad practice to edit your question to include new questions after an answer has been made that covers the original question. In the future, please create a new question for that. Apart from that leandriis is right: If you want your table to continue on another page you need a longtable. For centering you can add newcolumntype{P}[1]{>{centeringarraybackslash}p{#1}} after also having usepackage{array} and then use the Pcolumn type instead of the p one

    – Raven
    Mar 21 at 16:41




    1




    1





    i took liberty and add picture of table generated by suggested solution.

    – Zarko
    Mar 21 at 17:17





    i took liberty and add picture of table generated by suggested solution.

    – Zarko
    Mar 21 at 17:17











    3














    i would use tabularx table environment:



    documentclass{article}
    usepackage{tabularx}

    %---------------- show page layout. don't use in a real document!
    usepackage{showframe}
    renewcommandShowFrameLinethickness{0.15pt}
    renewcommand*ShowFrameColor{color{red}}
    %---------------------------------------------------------------%

    begin{document}
    begin{table}
    centering
    caption{Relationship of the lesson with the ARCS model}
    begin{tabularx}{linewidth}{|>{bfseries}l|X|}
    hline
    Attention & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
    hline
    Relevance & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
    hline
    Confidence & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
    hline
    Satisfaction & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
    hline
    end{tabularx}
    end{table}
    end{document}


    which gives



    enter image description here



    (red lines indicate text borders).






    share|improve this answer




























      3














      i would use tabularx table environment:



      documentclass{article}
      usepackage{tabularx}

      %---------------- show page layout. don't use in a real document!
      usepackage{showframe}
      renewcommandShowFrameLinethickness{0.15pt}
      renewcommand*ShowFrameColor{color{red}}
      %---------------------------------------------------------------%

      begin{document}
      begin{table}
      centering
      caption{Relationship of the lesson with the ARCS model}
      begin{tabularx}{linewidth}{|>{bfseries}l|X|}
      hline
      Attention & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
      hline
      Relevance & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
      hline
      Confidence & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
      hline
      Satisfaction & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
      hline
      end{tabularx}
      end{table}
      end{document}


      which gives



      enter image description here



      (red lines indicate text borders).






      share|improve this answer


























        3












        3








        3







        i would use tabularx table environment:



        documentclass{article}
        usepackage{tabularx}

        %---------------- show page layout. don't use in a real document!
        usepackage{showframe}
        renewcommandShowFrameLinethickness{0.15pt}
        renewcommand*ShowFrameColor{color{red}}
        %---------------------------------------------------------------%

        begin{document}
        begin{table}
        centering
        caption{Relationship of the lesson with the ARCS model}
        begin{tabularx}{linewidth}{|>{bfseries}l|X|}
        hline
        Attention & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
        hline
        Relevance & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
        hline
        Confidence & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
        hline
        Satisfaction & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
        hline
        end{tabularx}
        end{table}
        end{document}


        which gives



        enter image description here



        (red lines indicate text borders).






        share|improve this answer













        i would use tabularx table environment:



        documentclass{article}
        usepackage{tabularx}

        %---------------- show page layout. don't use in a real document!
        usepackage{showframe}
        renewcommandShowFrameLinethickness{0.15pt}
        renewcommand*ShowFrameColor{color{red}}
        %---------------------------------------------------------------%

        begin{document}
        begin{table}
        centering
        caption{Relationship of the lesson with the ARCS model}
        begin{tabularx}{linewidth}{|>{bfseries}l|X|}
        hline
        Attention & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
        hline
        Relevance & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
        hline
        Confidence & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
        hline
        Satisfaction & Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim molestie massa, ac mattis massa varius nec. Morbi vitae ullamcorper est. Phasellus mollis tristique ipsum sed ullamcorper. Nulla vel venenatis tellus. In hac habitasse platea dictumst. Donec pretium metus sit amet erat tristique, non mollis velit pharetra. \
        hline
        end{tabularx}
        end{table}
        end{document}


        which gives



        enter image description here



        (red lines indicate text borders).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 21 at 10:40









        ZarkoZarko

        127k868167




        127k868167






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480652%2fprevent-table-from-going-off-page-how%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            Puebla de Zaragoza

            Musa