Skip to content
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

Allow custom cell_fill_mode in tables #1117

Merged
merged 2 commits into from
Mar 1, 2024
Merged

Conversation

Lucas-C
Copy link
Member

@Lucas-C Lucas-C commented Feb 20, 2024

It will now be possible to define your own cell-filling logic:

class EvenOddCellFillMode():
    @staticmethod
    def should_fill_cell(i, j):
        return i % 2 and j % 2

with pdf.table(cell_fill_color=lightblue, cell_fill_mode=EvenOddCellFillMode()) as table:
    ...

@Lucas-C Lucas-C force-pushed the allow-custom-cell-fill-mode branch from 02ba3c0 to c44cbff Compare February 29, 2024 18:36
@Lucas-C
Copy link
Member Author

Lucas-C commented Feb 29, 2024

@Lucas-C Lucas-C force-pushed the allow-custom-cell-fill-mode branch from bd8b7d4 to fc56c54 Compare February 29, 2024 18:42
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 93.75000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 93.27%. Comparing base (b7e9b11) to head (218a0af).

❗ Current head 218a0af differs from pull request most recent head fc56c54. Consider uploading reports for the commit fc56c54 to get more accurate results

Files Patch % Lines
fpdf/enums.py 93.75% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1117   +/-   ##
=======================================
  Coverage   93.26%   93.27%           
=======================================
  Files          30       30           
  Lines        9215     9228   +13     
  Branches     2099     2103    +4     
=======================================
+ Hits         8594     8607   +13     
  Misses        379      379           
  Partials      242      242           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Lucas-C Lucas-C merged commit 7e1efc2 into master Mar 1, 2024
13 checks passed
@Lucas-C Lucas-C deleted the allow-custom-cell-fill-mode branch March 6, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants