lemmin Posted May 10, 2010 Share Posted May 10, 2010 I want to name a file with .html with text/html content in it, but have it open with Microsoft Excel. Since I don't think this is possible, I will explain further what I am trying to do: I want to print (physically) a table with a specific format including coloring and borders. The problem is that most browsers are going to remove the background colors and pictures when printing. My idea as an alternative was to create a download for the users that will open in a program separate from their browser that I can format a table with colors. Microsoft Excel will open an HTML document and use the css to format the cells, but I can't force the user to use a specific program when opening. The only other solution I can come up with is to manually write an xls file. I looked into the file structure and it gets pretty complicated once you get into the formatting. Is there maybe a different file type that would be easier to do this with? Thanks for any ideas Link to comment https://forums.phpfreaks.com/topic/201309-defining-a-file-with-headers/ Share on other sites More sharing options...
kenrbnsn Posted May 11, 2010 Share Posted May 11, 2010 Your best bet is to generate a PDF file with your formatted table in it. In another thread, TCPDF was mentioned. I haven't used it yet, but looking at the examples, it looks like it could solve your problem. Ken Link to comment https://forums.phpfreaks.com/topic/201309-defining-a-file-with-headers/#findComment-1056209 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.