Comments (7)
how can i rotate a big table in jspdf auto table plugin??
from jspdf-autotable.
my margins are also not being applied so maybe something is up in general. here is the whole code
var cols = [
{ title: "Food", key: "food" },
{ title: "Amount", key: "amount" },
{ title: "Serving Size", key: "servingSize" },
{ title: "Protein", key: "protein" },
{ title: "Carbs", key: "carbs" },
{ title: "Fat", key: "fat" },
{ title: "Calories", key: "calories" }
];
doc.setFontSize(20);
doc.text($scope.selectedDay.name, 40, 48);
angular.forEach($scope.selectedDay.sets, function (set) {
angular.forEach(set.meals, function (meal) {
var rows = [];
angular.forEach(meal.items, function (item) {
rows.push({
"food": item.food.name,
"amount": item.amount,
"servingSize": "cup",
"protein": "0",
"carbs": "0",
"fat": "0",
"calories": "0"
});
});
doc.autoTable(cols, rows, { margins: { horizontal: 40, top: 60, bottom: 40 }});
});
});
doc.save('table.pdf');
from jspdf-autotable.
Everything seems to be in order, however since you don't specify the startY position, they all get printed on the same place.
Checkout the multiple tables example in examples/examples.js for an example how to use the startY option.
from jspdf-autotable.
thanks bud will do!
from jspdf-autotable.
also a cool feature would to have an autoTableCollection method that took in an array and made sure if the entire table did not fit on the page it would go to the next. damn end users.. :)
from jspdf-autotable.
Sounded like a good idea! I added an avoidPageSplit option now (version 1.1) which draws the table on a fresh page instead of splitting it up into multiple pages if its height is too long. You can see how it works in the same "Multiple tables" example. I don't think a autoTableCollection method would be a good idea though. That would require the plugin to keep track of the height of custom headers etc which would complicate the api.
UPDATE In version 2.0 avoidPageSplit
has become pageBreak: 'avoid';
from jspdf-autotable.
awesome man will try it out! thanks again the plugin is really saving my butt!
from jspdf-autotable.
Related Issues (20)
- 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
- Multitable loop doesn't align properly and creates unusual gaps or overlaps each other HOT 11
- 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 7
- Some columns are shrinked because of large texts in some columns HOT 2
- I wanted to highlight some part of text in cell text. HOT 1
- How to set specific startY even after page break HOT 1
- Autotable heading or subheading HOT 1
- Text with horizontal spaces are going out of cell boundry or text is hidden under the next column. HOT 1
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.