Comments (5)
The styles options are not respected because useCss
is set to true
thus the CSS styles are used rather than the provided style options.
Although you commented out the CSS styles, the table still has CSS styles, even if you set padding: unset
CSS rule, it will get parsed to 0px
padding so cellPadding
won't be respected.
When using cssStyle: true
you should use CSS rules to style your table, if you want padding add padding in the CSS.
from jspdf-autotable.
Well, it is not the style options that are not respected. Only cellPadding
is not respected. If I add this style fillColor: [100, 0, 100]
to bodyStyles, it will be respected and applied, but cellPadding
will not.
from jspdf-autotable.
You will find that some styles may apply like fillColor because the background color is none, but most won't because CSS styles will override it, so this isn't a bug really.
If you want to style the table yourself with style options, set useCss
to false
, and theme
to 'plain'
and add the styles you want.
useCss: false,
theme: 'plain',
from jspdf-autotable.
I want both of them - CSS and style options - and assumed that style options override CSS, but it appears to be the opposite. I create the PDF from dynamic tables that bring their own styles I want to keep, like fonts, colors, etc. But I also want to have equal styles for all tables like the cell padding.
The only escape hatch I found so far that worked for me is borrowed from this SO answer where they used the didParseCell
hook to override any styles using style options.
from jspdf-autotable.
I think it also make sense that options override html parsing. But as mentioned above right now the plugin might override some values either incorrectly.
from jspdf-autotable.
Related Issues (20)
- Does anybody created invoice template using this feature? HOT 1
- Ensure table fits in single page regardless of end size HOT 1
- Como puedo cambiar la localizacion de la tabla en el eje x? HOT 2
- 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 1
- 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
- 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
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.