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

adjust column size to accommodate uppercase letters #157

Open
florian08fr opened this issue Oct 19, 2024 · 1 comment
Open

adjust column size to accommodate uppercase letters #157

florian08fr opened this issue Oct 19, 2024 · 1 comment

Comments

@florian08fr
Copy link

florian08fr commented Oct 19, 2024

hello.
thanks for your class, it's really useful.
when a cell contains text in uppercase only, a column width adjustment could be done line 831:

$vl = mb_strlen($v);

by adding something like:
$vl+=intval(0.2*mb_strlen(preg_replace('![^A-Z]+!', '', $v)));

Also, it could be very useful to have a parameter that deactivates the limitation of the column width to the value 60 in line 961, or alternatively that the value 60 be customizable in the default variables, without having to define a fixed column width in our php script:

$w = isset($this->sheets[$idx]['colwidth'][$k]) ? $this->sheets[$idx]['colwidth'][$k] : min($max + 1, 60);

best regards.

@shuchkin
Copy link
Owner

just use setColWidth

public function setColWidth($col, $width)

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

2 participants