![]() |
How set column width using mso-... in style sheet ?
Hi,
I have a web page created by a servlet and set its mime type to Excel so it opens in Excel. I am able to tell Excel how to format the data for example by using the following in the style sheet ..mystyle { mso-number-format:"\#\,\#\#0\.000"; } This formats with commas and three decimal places. I would like to automatically reduce the width of each column to the minimum. (Can do this manually by double clicking the line between the column tops, or in VBA using Columns("A:M").EntireColumn.AutoFit ) Is there a mso-... style to do this? Is there a mso- reference anywhere? I have found things like mso-width-source: userset; width=200pt but this does not seem to work and does not do what I want anyway. Many thanks! Stephen Chalkley |
How set column width using mso-... in style sheet ?
Hi Stephen,
There is a style attribute "mso-width-source" which you can set to "auto", but I don't think this will affect how it is displayed in the resulting HTML document. I believe it's only there for round-tripping (telling XL what to do when you open the HTML document in XL again). I guess you could modify the resulting <td tags by taking out the width attributes - that may work for you. -- Regards, Jake Marx MS MVP - Excel www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Stephen Chalkley wrote: Hi, I have a web page created by a servlet and set its mime type to Excel so it opens in Excel. I am able to tell Excel how to format the data for example by using the following in the style sheet .mystyle { mso-number-format:"\#\,\#\#0\.000"; } This formats with commas and three decimal places. I would like to automatically reduce the width of each column to the minimum. (Can do this manually by double clicking the line between the column tops, or in VBA using Columns("A:M").EntireColumn.AutoFit ) Is there a mso-... style to do this? Is there a mso- reference anywhere? I have found things like mso-width-source: userset; width=200pt but this does not seem to work and does not do what I want anyway. Many thanks! Stephen Chalkley |
All times are GMT +1. The time now is 01:15 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com