Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Spreadsheet column width from html

I am trying to create a spreadsheet from mysql data via a php page. I
have the
requisite headers in place for content type and all that.
All I am doing is executing the SQL query and displaying the retrieved
data formatted in an HTML table. Each <tdblah</td corresponds to a
cell in the spreadsheet

Whatever width I assign to the HTML table columns ( using <td
width="nnn" it doesn't have any impact on the width of the
spreadsheet column- that is always staying the same.

Any idea how to specify the width?

The headers I am using are as follows
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=report.xls");
header("Pragma: no-cache");
header("Expires: 0");
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 1,588
Default Spreadsheet column width from html

Have you tried something like

<td style="width: 200px"content</td

?

You might also consider using an XML file (obtained by saving a "template"
report in XML format from Excel) and then inserting your queried content
into that file (eg. by replacing a piece of placeholder text).

Tim


"sumithar" wrote in message
...
I am trying to create a spreadsheet from mysql data via a php page. I
have the
requisite headers in place for content type and all that.
All I am doing is executing the SQL query and displaying the retrieved
data formatted in an HTML table. Each <tdblah</td corresponds to a
cell in the spreadsheet

Whatever width I assign to the HTML table columns ( using <td
width="nnn" it doesn't have any impact on the width of the
spreadsheet column- that is always staying the same.

Any idea how to specify the width?

The headers I am using are as follows
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=report.xls");
header("Pragma: no-cache");
header("Expires: 0");



  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Spreadsheet column width from html

On Jun 22, 6:46*pm, "Tim Williams" <timjwilliams at gmail dot com
wrote:
Have you tried something like

<td style="width: 200px"content</td

?

You might also consider using an XML file (obtained by saving a "template"
report in XML format from Excel) and then inserting your queried content
into that file (eg. by replacing a piece of placeholder text).

Tim

"sumithar" wrote in message

...



I am trying to create a spreadsheet from mysql data via a php page. *I
have the
requisite headers in place for content type and all that.
All I am doing is executing the SQL query and displaying the retrieved
data formatted in an HTML table. *Each <tdblah</td corresponds to a
cell in the spreadsheet


Whatever width I assign to the HTML table columns ( using <td
width="nnn" it doesn't have any impact on the width of the
spreadsheet column- that is always staying the same.


Any idea how to specify the width?


The headers I am using are as follows
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=report.xls");
header("Pragma: no-cache");
header("Expires: 0");- Hide quoted text -


- Show quoted text -


Thanks for the XML tip. Turns out the problem I had was 'cos I didn't
realise I was trying to open the spreadsheet w/ Open Office calc. It
works the way I want it to with Excel. The width attribute in <td
does control the width of the Excel column as well.
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 to change column width of the default start-up spreadsheet? Jeter Setting up and Configuration of Excel 3 December 31st 20 02:23 PM
how to export a spreadsheet with column width over 255 maximum excelallows? [email protected] Excel Discussion (Misc queries) 4 February 17th 09 10:22 PM
changing html code to increase column width does not reflect in ex Dev in soup Excel Discussion (Misc queries) 0 July 2nd 08 12:16 PM
Spreadsheet column width from html sumithar Excel Discussion (Misc queries) 2 June 23rd 08 06:26 PM
Create a macro which takes a column name and width and sets the column width to what it should be Ag Excel Programming 4 September 29th 07 11:29 PM


All times are GMT +1. The time now is 05:04 AM.

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"