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

Setting rich text #172

Closed
mbresson opened this issue Dec 22, 2017 · 8 comments
Closed

Setting rich text #172

mbresson opened this issue Dec 22, 2017 · 8 comments
Labels
enhancement New feature or request

Comments

@mbresson
Copy link

Hi,
first, thanks creating for this library, it's very useful.

I would like to know if it's possible to have rich text inside a cell? What I mean by rich text is text with a rich format, for instance "Hello world" where world is bold but Hello isn't. I have tried to dabble with SetCellStr and SetCellDefault with content such as "Hello <font style='weight:700'>world</font>" (I don't know a lot about XLSX format so my example may be wrong) but the cell value ends up escaped (with SetCellDefault too).

Thanks!

@xuri
Copy link
Member

xuri commented Dec 22, 2017

Thanks for your issue, reference issue #69 (set multiline texts to cells support) and #100. I have added this feature request to the Roadmap.

@xuri xuri added the enhancement New feature or request label Dec 22, 2017
@mbresson
Copy link
Author

Thanks
Do you think there is a lot of work required to complete this feature, and do you already have a clear idea of how to implement it? Maybe I could lend you a hand depending on what's needed

@xuri
Copy link
Member

xuri commented Dec 22, 2017

Welcome! The cell's text style (include font, size, color, bold, underline, etc.) is stored in the file: xl/sharedStrings.xml and the data structure of this file is defined in xmlSharedStrings.go. In order to implement this feature, we need to refactor functions: GetCellValue() and SetCellValue(), change the interface to make them get/set the value and style from the xl/sharedStrings.xml, and add new function SetCellValueWithStyle().

@mbresson
Copy link
Author

Hi,
sorry, I'm quite busy these days so I'm not able to work on this. If someone else wants to do it, feel free. Otherwise I'll let you know if I have time again to do it.

@IceTeaz
Copy link

IceTeaz commented Sep 20, 2019

hi,will this feature be implemented in the future?

@xuri
Copy link
Member

xuri commented Sep 20, 2019

Yes, I have added this feature request to the Roadmap.

@xuri xuri added the in progress Working in progress label Apr 5, 2020
@xuri xuri closed this as completed in 66d0272 Apr 5, 2020
@xuri
Copy link
Member

xuri commented Apr 5, 2020

Hi @mbresson and @VioletEvergardenZ. Sorry for my late reply. I have added rich text support for this lib, now you set cell with rich text by the SetCellRichText function.

@xuri xuri removed the in progress Working in progress label Apr 5, 2020
@mbresson
Copy link
Author

mbresson commented Apr 7, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants