How to keep the entire table together?

조회 수: 7 (최근 30일)
John
John 2020년 12월 9일
편집: John 2020년 12월 31일
Before updating to R2020b, the table can be kept together (if the space below isn't enough, the table is generated in next page).
However, after updated to R2020b, the same thing doesn't work any more. We noticed quite a few things stopped working in R2020b. But we found the solution.
But we cann't find solution for this, even tried parentheses with (true) for KeepLinesTogether and KeepWithNext, no chance.
How can we do to keep a table together?
(we cannot predict the page content and place a PageBreakBefore() at the right place.

답변 (1개)

Ani Singh
Ani Singh 2020년 12월 28일
To know about how to start a table on the next page if it does not fit into a single page, and how to split the table if the table is longer than the page.
Please check the following links for more information:
  1. In order to ensure that the table starts on the new page, consider using PageBreakBefore class to add a page break before your object. This will specify to always start the associated object on a new page.
  2. If the table is longer than the page itself, consider the AllowBreakAcrossPages class. This will specify whether to allow a row to start on the next page when it cannot fit on the current page, or to allow it to flow to the next page when it cannot fit in one page.
  3. If your table is too wide to fit in one one page, this example shows how to fit wide tables using the Table Slicer object, and to resize columns accroding to their content.
  댓글 수: 1
John
John 2020년 12월 28일
편집: John 2020년 12월 31일
Those are not solutions for the topic in discussing.
(1) the space are not predictable to place the "PageBreakBefore" at fixed location;
(2) the table is NOT longer than the page itself;
(3) the table is NOT too wide either;
The topic is that a page can host a few tables. When the remaining page is not enough for the next table, it will start in next page. Before R2020b, it was done in following way and worked well:
thetable.Style = [thetable.Style {KeepLinesTogether(true)}];
thetable.TableEntriesStyle = [thetable.TableEntriesStyle {KeepWithNext(true)}];
R2020b ignores these commands and breaks the table in two pages with part in last page and part in next page.
How can it work in R2020b?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by