Only way to do this is with javascript.
PHP is static, you can't change how something looks after the page loads.
However, I don't think you can fetch the width of a displayed cell in Javascript. The width as defined in the source code may be fetchable, but the width (in pixels) that it is currently displayed cannot.