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

Extra space (margin) below text in each AsciiDoc table cell #1513

Closed
janicemhdc opened this issue Jan 23, 2020 · 9 comments
Closed

Extra space (margin) below text in each AsciiDoc table cell #1513

janicemhdc opened this issue Jan 23, 2020 · 9 comments

Comments

@janicemhdc
Copy link
Contributor

I will have to come back later with an example if you need one, but I wanted to quickly capture this before I need to log off.

In each of my (admittedly few) PDF documents with tables, each row is sizing to leave blank space at bottom of the row that's the equivalent of an extra row of text. HTML leaves a more reasonable 1/3 of a row or so of space by default.

It seems to me that the default behavior should be similar to the HTML behavior and the current default white space is excessive. That said, is there any way to adjust this without creating a new theme? I'm using the default styling/theme and would prefer to keep it that way.

@mojavelinux
Copy link
Member

I agree this is not ideal. But I don't know how to solve it. The way margins work in the PDF theming system is nothing like in HTML. In short, we don't have the same capabilities here as HTML/CSS does in that we don't have margin collapsing. There's a possibility that the converter could keep track of the last margin it applied, and roll it back if it falls at the end of the cell. But that's a big if. I'm not sure if the converter has he opportunity in the call chain to do that since the table is being rendered by a different library (prawn-table).

To be clear, it's not an empty blank line. It's a bottom margin that isn't being collapsed.

@mojavelinux mojavelinux changed the title Extra blank line below text in each row of table using default theme Extra space (margin) below text in each row of table using default theme Jan 23, 2020
@mojavelinux mojavelinux changed the title Extra space (margin) below text in each row of table using default theme Extra space (margin) below text in each AsciiDoc table cell Jan 23, 2020
@mojavelinux
Copy link
Member

This happens specifically for AsciiDoc table cells. It's also not related to the default theme. It affects all themes because it's how the margin is applied, not how the margin is defined.

@mojavelinux mojavelinux added this to the future milestone Jan 23, 2020
@janicemhdc
Copy link
Contributor Author

janicemhdc commented Jan 24, 2020

Well that's unfortunate. Thanks for letting me know why it's happening.

@mojavelinux
Copy link
Member

I went for a stroll and I'm happy to say I may have figured out how to make this work in a simple way. I'm still in the process of proving the idea. Refer to #1515 to follow my progress.

@janicemhdc
Copy link
Contributor Author

Great! I've followed that issue. Too bad it's not backwards compatible, but such is life.

@mojavelinux
Copy link
Member

mojavelinux commented Jan 24, 2020 via email

@CWempe
Copy link

CWempe commented Jul 26, 2020

I just want to leave an example, because I have the same issue.
It is unfortunate it cannot be solved before v2.0.0.

Example:

|=== 

h| Header 1 h| Header 2 h|Header 3

| Row 1
| Row 1
| Row 1

| Row 2
a| Row 2
| Row 2

|=== 

image

@mojavelinux
Copy link
Member

Thanks for the use case.

I'm not really working on 1.5.x anymore. All eyes are on 2.0.0. But I don't expect the transition to be difficult.

@mojavelinux
Copy link
Member

This issue is being addressed by #1515.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Apr 14, 2022
…vent extra space below blocks, particularly nested blocks

additionally,

resolves asciidoctor#1513
resolves asciidoctor#1845
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Apr 14, 2022
…vent extra space below blocks, particularly nested blocks

additionally,

resolves asciidoctor#1513
resolves asciidoctor#1845
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Apr 14, 2022
…vent extra space below blocks, particularly nested blocks

additionally,

resolves asciidoctor#1513
resolves asciidoctor#1845
@mojavelinux mojavelinux removed their assignment Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants