Comments (11)
I would get pageNumber
of both tables, table1:2
> table2:1
then I would get finalY
of table1 (120
) (because it spans more pages) and draw table3 giving startY
using this.
Edit: don't forget to set the current doc page when drawing table3 to be the starting page + pageNumber of the longest table.
from jspdf-autotable.
Check out this example with a similar layout of what you want :
https://simonbengtsson.github.io/jsPDF-AutoTable/#multiple
code : https://github.com/simonbengtsson/jsPDF-AutoTable/blob/master/examples/examples.js#L135
from jspdf-autotable.
Check out this example with a similar layout of what you want :
https://simonbengtsson.github.io/jsPDF-AutoTable/#multiple
code : https://github.com/simonbengtsson/jsPDF-AutoTable/blob/master/examples/examples.js#L135
We've got six units, and for each unit, we're generating tables for both deposits and withdrawals. The thing is, these tables can vary in length. Sometimes, one might be longer than the other.
To keep things neat, I'm trying to align these tables properly. My plan is to figure out which table (deposits or withdrawals) is longer, and then start the next table from where the longest one ends.
But here's the snag: when one of the tables stretches onto a new page, the coordinates go wonky. This messes up my calculations, especially when I'm trying to find the length of the longest table.
So, I'm looking for a way to handle this gracefully. I need to adjust the table positions dynamically, considering page breaks and making sure everything stays in place, regardless of how long the tables get.
Any ideas on how we can tackle this?
from jspdf-autotable.
I didn't review your code, but you would need to utilize pageNumber
& finalY
properties of the drawn tables to determine the longest one and draw the next table with startY
accordingly.
from jspdf-autotable.
I didn't review your code, but you would need to utilize
pageNumber
&finalY
properties of the drawn tables to determine the longest one and draw the next table withstartY
accordingly.
thanks but I am struck on this since many days.
I think this package owners dont reply to queries anymore.
I will try some other package.
from jspdf-autotable.
I'm a collaborator in this project, you haven't shown an actual bug in the package, rather, you're unable to achieve a certain layout which is a question better suited for StackOverflow. our time is limited and we spend it trying to improve the package.
Closing this for now, please feel free to reopen if you discover an actual bug and are able to reproduce it in a codepen.
from jspdf-autotable.
from jspdf-autotable.
I don't see any bugs there, you have pageNumber
, finalY
and startY
which gives you the ability to figure out the pages spanned by the table, and the last Y position of the table on the last page, using this you could easily set the next table startY
, if any of these don't work as expected or give a wrong value please feel free to report a specific bug, I might add an example demonstrating this when I have the time.
from jspdf-autotable.
from jspdf-autotable.
I would get
pageNumber
of both tables, table1:2
> table2:1
then I would getfinalY
of table1 (120
) (because it spans more pages) and draw table3 givingstartY
using this.Edit: don't forget to set the current doc page when drawing table3 to be the starting page + pageNumber of the longest table.
I used this and was able to achieve the desired layout.
Thanks alot.. I was struck on this for 2 weeks.
Finally decided to make a post and it helped me. <3
bankReportAxisBank2024-04-16.pdf
I have attached a desired output file.
Can I contribute and add an example of multitable with loop spanning multiple pages example?
Or you can add it so others can benefit too?
from jspdf-autotable.
I'm glad to hear that.
We are currently working on v4 which includes breaking changes so no use of adding new examples at the moment, it could be added after v4 is released.
from jspdf-autotable.
Related Issues (20)
- you can apply RTL and use Arabic font finally HOT 2
- Rendering html tags as cell content and formatting of cell content HOT 1
- Problem with horizontalPageBreak with colspan column header HOT 2
- Memory is not deallocating for autotable. js heap is increasing eventhough for small amount of data HOT 6
- HTML Entities or HEX Code issues for symbols HOT 5
- line breaks are not working
- Change row colors on page break HOT 1
- jspdf Auto Table, can we break the if the lines are more than 10 HOT 1
- (0 , import_jspdf_autotable.default) is not a function HOT 9
- Textfield Signature?
- 表格项合并时表格项与表头信息不对应 HOT 2
- HorizontalPageBreak page break can continue on same page if vertical space is enough HOT 6
- Cannot Read html tags HOT 1
- Merge Cell Inside the body of the table HOT 1
- Parsing HTML with tables HOT 1
- Rowspan on heading HOT 1
- Inconsistent Table Width Across Pages When Exporting Using jsPDF-AutoTable HOT 4
- Table Border is off and value is not displayed when the first column is having large rowSpan. HOT 3
- Some columns are shrinked because of large texts in some columns HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jspdf-autotable.