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

Html Writer Minor Fixes #4089

Merged
merged 5 commits into from
Jul 12, 2024
Merged

Html Writer Minor Fixes #4089

merged 5 commits into from
Jul 12, 2024

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Jul 7, 2024

While researching issue #1551, I came across some minor problems.

When a spreadsheet does not have a title, which is often the case for spreadsheets created with Excel (note that this is not the case for spreadsheets created with PhpSpreadsheet), if you try to save it as Html, it throws an exception. It will now use the sheet title of the active sheet as a title in this case.

When writing an Html spreadsheet using useInlineCss(true), gridlines are not handled properly. This is addressed by adding class=gridlines gridlinesp to the cell's td tag, and by suppressing any border attributes which would be styled as none #000000. It would be unusual to turn off gridlines for specific cells, but that can still be accomplished by using Border::BORDER_NONE in conjunction with any color other than #000000 - see new test testHideSomeGridlines.

This is:

  • a bugfix
  • a new feature
  • refactoring
  • additional unit tests

Checklist:

  • Changes are covered by unit tests
    • Changes are covered by existing unit tests
    • New unit tests have been added
  • Code style is respected
  • Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
  • Documentation is updated as necessary

Why this change is needed?

Provide an explanation of why this change is needed, with links to any Issues (if appropriate).
If this is a bugfix or a new feature, and there are no existing Issues, then please also create an issue that will make it easier to track progress with this PR.

While researching issue PHPOffice#1551, I came across some minor problems.

When a spreadsheet does not have a title, which is often the case for spreadsheets created with Excel (note that this is not the case for spreadsheets created with PhpSpreadsheet), if you try to save it as Html, it throws an exception. It will now use the sheet title of the active sheet as a title in this case.

When writing an Html spreadsheet using `useInlineCss(true)`, gridlines are not handled properly. This is addressed by adding `class=gridlines gridlinesp` to the cell's `td` tag, and by suppressing any border attributes which would be styled as `none #000000`. It would be unusual to turn off gridlines for specific cells, but that can still be accomplished by using `Border::BORDER_NONE` in conjunction with any color other than `#000000` - see new test `testHideSomeGridlines`.
@oleibman oleibman enabled auto-merge July 12, 2024 16:29
@oleibman oleibman added this pull request to the merge queue Jul 12, 2024
Merged via the queue into PHPOffice:master with commit 88908a8 Jul 12, 2024
12 of 13 checks passed
@oleibman oleibman deleted the issue1515minor branch July 12, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant