-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
rendering goes crazy if non-integer Row height is specified or no columns in row. #414
Comments
I have been getting the same issue with the breaking layout when I was adding a lot of generated tables. I was trying to make the tables the way so that when they do not have enough space on a page they would appear on the second one. I didn't want them to break in the middle. Not sure if the issue is connected with yours but I think it was happening because something was going wrong with automatic page breaking. I think it has some issues when there is not enough space for a row to appear. I assumed it was making some weird stuff to the layout. The solution I came up with was to check whether the row would have enough space on the page. If not it would fill in the page with an empty row with a height of space that was left on a page(float64). It helped but not really sure what was causing the error |
We only have to add an if to check of cols are empty, if is we should add an empty column to it. Lines 103 to 107 in 4f5e446
|
I think that the same should be done here: Lines 94 to 96 in 4f5e446
|
can't I add columns AFTER m.AddRow() call? especially taking into account that it returns *Row one is tempted to do smth like |
Bro, the library is not to use like this...See the documentation there is none example using like this... There are a bunch of examples here... |
It seems to be easy to implement, but I was thinking: as it is not possible to use a row without columns, wouldn't it be better to do this validation when the row is created: |
Fixed error when using empty columns in this release: https://github.com/johnfercher/maroto/releases/tag/v2.0.0-beta.19 |
In my project I just created simple rows with 2 columns. I didn't read through all the comments here, but I just wanted to tell you about the problems I had, which seem to be related to this issue. I fixed the problem in my project by just rounding up to the nearest integer, so maybe my simple solution could also be implemented directly in maroto? |
Describe the bug
I generate a large multi row table by calling m.AddRow(4, text.NewCol(...)). It worked perfect until I added some empty lines as padding like this:
m.AddRow(1)
and after that everything goes crazy - line backgrounds and content are shown separately at some distance from each other... Luckily, I found a workaround as
m.AddRow(1, text.NewCol(12, ""))
Similar issue if I use fractional row height with lines like
m.AddRows(line.NewRow(0.1, props.Line{Thickness: 0.1, SizePercent: 100}))
.The text was updated successfully, but these errors were encountered: