-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Is it possible to assign background color to a table cell? #29
Comments
Hi, I try to use this library and it's very simple and fun. thanks |
Not yet Sorry, I've been very busy during last 3 weeks, I'll get back to pdfmake next week. |
Ok, thanks for your answer! |
Hi, sorry, but I need to use this feature. Thanks |
I would like to add that I could really use this feature as well. |
Yes, It could be really useful. And It would be great not only to a cell, also to a complete row. Thanks |
Needed that for my app so i added some lines of code to tableProcessor.js; var layout = {
hLineWidth: function(i, node) { ... },
vLineWidth: function(i, node) { ... },
hLineColor: function(i, node) { ... },
vLineColor: function(i, node) { ... },
//you just return null for the rest
fillColor: function(row, col, node) { return row > 0 && row % 2 ? 'yellow' : null; }
} here is a plunker to test Not sure if that will fit well the rest o library but i tested it and it works well (even against variable border sizes) |
Nice work yelouafi. [{ text: 'Cell text', style: 'headerTable', colSpan:2, fillColor:'red'},{}] |
Hmm, I'm not seeing this working in Chrome on plunker. Is this this working? |
Sorry I was fixing some issues and did some branching reset [{ text: ...., fillColor: 'yellow'}] And since it's style property you can also use the library styling capabilities (style dictionaries, style overrides) var docDef = {
.....
[{ text: ...., style: 'myCell'}]
.....
styles: {
myCell: { fillColor: 'yellow' }
} |
It is working very well! @yelouafi :Before I implement it on my production server, I would like to know if this new library is the same as the original, only with the change of the fillColor? I have been comparing them and there are several changes. @bpampuch : Are you going to implement this changes to your original file? It would be great not to divide the project, Thanks. |
@onbermejo the only changes are (the master branch includes also the latest builds)
you can also checkout the tableCellFillColor and run your own builds locally BTW you may also find it useful to merge the textDecorator And just a last EDIT: i don't intend to create a new library from this fork; all those features are intended to enhance the main library (which i find awesome to have in the node.js archipel). as for the integration into the main library i already made this pull requests #82 and #79; |
Thanks, yelouafi. I just wasn't sure if I was doing something incorrect at the time or using an unsupported I appreciate your efforts on this project. You are doing some pretty cool things. |
PR has been merged |
Hi |
Is it possible to assign background color to a table cell?
thanks, library is awesome
The text was updated successfully, but these errors were encountered: