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

Applying style to a raw value #142

Open
merkiw opened this issue Mar 26, 2024 · 3 comments
Open

Applying style to a raw value #142

merkiw opened this issue Mar 26, 2024 · 3 comments

Comments

@merkiw
Copy link

merkiw commented Mar 26, 2024

Is there a way to apply a style (e.g. make the text bold) on a raw value (e.g. of a script)?

use Shuchkin\SimpleXLSXGen;

$rows = [
    // prints the whole string correctly
    [SimpleXLSXGen::raw('<a href="#">some link</a>')], 

    // prints the whole string correctly
    [SimpleXLSXGen::raw('<b><a href="#">some link</a></b>')], 

    // prints a bolded hyperlink 'some link' instead of a bolded raw string "<a href="#">some link</a>"
    ['<b>' . SimpleXLSXGen::raw('<a href="#">some link</a>'). '</b>'], 
];

SimpleXLSXGen::fromArray($rows)
    ->downloadAs('test_raw.xlsx');

This prints out these values:
image

I'm trying to make the 3rd row value to look like this:
image

@shuchkin
Copy link
Owner

shuchkin commented Apr 5, 2024

1.4.11 no way to format raw value

@mrjemson
Copy link
Contributor

I submitted a PR last year to add this functionality. It is well behind master now, but you can see my fork here;
https://github.com/mrjemson/simplexlsxgen

@shuchkin
Copy link
Owner

tag <raw> added in 1.4.12

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

No branches or pull requests

3 participants