Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I change column width in the middle of an Excel sheet? Malcolm Excel Discussion (Misc queries) 6 August 13th 09 10:40 AM
protect sheet but column width changes Gene Excel Worksheet Functions 1 March 23rd 09 01:32 PM
How to retain column width and formulas in copying a sheet smich Excel Discussion (Misc queries) 3 January 15th 09 03:55 PM
I want to change the column width on a spread sheet? Celia[_2_] Excel Worksheet Functions 1 July 13th 07 09:10 PM
How do I change sheet notation from R1C1 style to A1 style in XL 2 Sherlock1506 Setting up and Configuration of Excel 1 December 5th 06 03:22 PM


All times are GMT +1. The time now is 03:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"