Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds .cant_split and .cant_split? table methods. #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benjaminketron
Copy link

.cant_split allows one to describe a row or rows in such a way
that its contents cannot split across a page break and instead
positions the entire row on a new page.

For example

docx.table [['Header 1', 'Header 2'], ['Cell 1', 'Cell 2']] do
  cant_split rows[1]
end

or

docx.table [['Header 1', 'Header 2'], ['Cell 1', 'Cell 2']] do
  cant_split rows[1...-1]
end

After reviewing this with my colleagues the consensus is we might want to start gathering rows in a new TableRowModel where this type of thing can be kept. This PR might be updated relatively soon.

`.cant_split` allows one to describe a row or rows in such a way
that its contents cannot split across a page break and instead
positions the entire row on a new page.

For example

```
docx.table [['Header 1', 'Header 2'], ['Cell 1', 'Cell 2']] do
  cant_split rows[1]
end
```

or

```
docx.table [['Header 1', 'Header 2'], ['Cell 1', 'Cell 2']] do
  cant_split rows[1...-1]
end
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant