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

Theme added to the table, cant be fetched in the functionality #4078

Open
bokrma opened this issue Jun 28, 2024 · 9 comments
Open

Theme added to the table, cant be fetched in the functionality #4078

bokrma opened this issue Jun 28, 2024 · 9 comments

Comments

@bokrma
Copy link

bokrma commented Jun 28, 2024

hello,
am trying to fetch the theme styles related from the following file, but didn't find any functionality to be able to do that

-theme: "Reponsibles-style"
test table with styles (1).xlsx

can you please help me to fetch the details of the style of the theme

@oleibman
Copy link
Collaborator

$theme = $spreadsheet->getTheme();
// then use any of the methods in Theme do get the information you need

@bokrma
Copy link
Author

bokrma commented Jun 28, 2024

no not the default theme of the whole workbook
I mean the theme styles for the table it self like the colors for the columns and etc...
because currently its not fetching the table related stylings I can only get the theme name which is not the default theme of the whole excel file

@oleibman
Copy link
Collaborator

Hmm. Sorry for the misunderstanding. At any rate, you can get the name of the style easily enough:

$themeStyleName = $table->getStyle()->getTheme();

But I don't see anywhere in the spreadsheet where the actual styles used for that theme name are defined.

Now, if you have modified the theme for your table, I do see an entry in styles.xml for the specific parts of the style that you have overridden, e.g.

<tableStyles count="1" defaultTableStyle="TableStyleMedium9">
<tableStyle name="Table Style 1" pivot="0" count="1" xr9:uid="{38CE2BF8-AFBD-49CD-821A-24E92973F8A1}">
<tableStyleElement type="secondRowStripe" dxfId="0"/>
</tableStyle>
</tableStyles>

We do not currently process these tags. You might consider opening a feature request for this. It would probably be a bit of a challenge to implement, and we would probably not be able to provide the actual values for the parts of the style that you don't override. But perhaps you wouldn't need those, if, say, all you wanted to do with these is to use the same overrides on write that we were able to detect on read.

@bokrma
Copy link
Author

bokrma commented Jul 1, 2024

the idea is, all the styles for this table is not showing,please try to open it using excel sheet app, or google sheet online
you can see the difference am talking about
when I try with the library to get those styles, am not able to do that at all
so in this case the whole table has set of styles but couldn't fetch them anyhow

@oleibman
Copy link
Collaborator

oleibman commented Jul 1, 2024

As I said, I cannot find the table style details (except name) anywhere in the spreadsheet file. If you can, please let me know how.

@bokrma
Copy link
Author

bokrma commented Jul 3, 2024

I will look into the zipped file to see where are the values saved

@bokrma
Copy link
Author

bokrma commented Jul 3, 2024

ok you are right, there is no styles or theme defined for the one i asked you about,
but then another question, how to know which default style selected for the table from the following:
Screenshot 2024-07-03 at 14 01 14

@bokrma
Copy link
Author

bokrma commented Jul 8, 2024

do you have any idea about my last comment?

@oleibman
Copy link
Collaborator

oleibman commented Jul 8, 2024

I can tell what the default table style name is for a spreadsheet. Would that be useful enough for your purposes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants