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