Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Preserving HTML Column Widths in Excel

I have a web application that needs to export portions of certain pages to
Excel. To accomplish this I am generating the appropriate file with
properly-formatted HTML and downloading them. It all works except that the
column widths specified in the HTML are not being respected by Excel. I
tried creating a simple HTML file on my local system, saving it both as an
HTML file and as an XLS file. When I open the HTML file with IE it is
formatted correctly. When I open the XLS file with Excel, again the column
widths are not respected. A simple example is included below.

Is there a way to get Excel to properly recognize the column widths
specified in the HTML? Thanks in advance for your help.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
<html xmlns="http://www.w3.org/1999/xhtml"
<head
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /
<titleUntitled Document</title
</head

<body
<table width="576" border="0" cellspacing="0" cellpadding="0"
<tr
<td width="576"
<table width="576"
<tr
<td width="576"
<table width="576"
<tr
<td width="300"1</td
<td width="200"2</td
<td width="76"3</td</tr
<tr
<td width="300"4</td
<td width="200"5</td
<td width="76"6</td
</tr
<tr
<td width="300"7</td
<td width="200"8</td
<td width="76"9</td
</tr
<tr
<td width="300"10</td
<td width="200"11</td
<td width="76"12</td
</tr
</table
</td
</tr
<tr
<td width="576"
<table width="576"
<tr
<td width="300"Line 1</td
<td width="200"Col2</td
<td width="76"Col3</td
</tr
<tr
<td width="300"This is the second line</td
<td width="200"Column 2 of the second line</td
<td width="76"This is the third column of the second line. It is
the longest column.</td
</tr
<tr
<td width="300"1</td
<td width="200"2</td
<td width="76"3</td
</tr
</table
</td
</tr
<tr
<td width="576"
<table width="576"
<tr
<td width="300"a</td
<td width="200"b</td
<td width="76"c</td
</tr
<tr
<td width="300"d</td
<td width="200"e</td
<td width="76"f</td
</tr
</table
</td
</tr
</table
</td
</tr
</table
</body
</html

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
Changing column widths in excel Becky Robinson Paine Excel Discussion (Misc queries) 2 June 18th 06 12:55 PM
preserving column width format in excel pivot tables Colin Foster Excel Discussion (Misc queries) 0 February 9th 06 02:18 PM
Excel column widths Rachael Excel Discussion (Misc queries) 6 October 19th 05 09:08 PM
Excel - One column, multiple widths?? jpw[_2_] Excel Programming 4 May 18th 05 09:36 PM
Fix column widths in Excel template John Garate Excel Programming 1 February 9th 05 03:04 PM


All times are GMT +1. The time now is 10:11 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"