Solved

Turn on Grid lines in Excel with ColdFusion

Posted on 2009-07-01
2
1,160 Views
Last Modified: 2013-12-20
I'm outputting data to a html table  with colfusion and saving that with cfcontent and cfheader..

All works except there are no grid lines.

If I add to the table border=1 - only the data gets a border.

How do i turn on the grid lines?
How do I do it for the entire work sheet?
0
Comment
Question by:PhotoMan2000
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 250 total points
ID: 24760468
> If I add to the table border=1

Yes, basic html won't work for those types of properties. You need to mso.  Here is a slight modification of an example from:
http://blogs.lessthandot.com/index.php/WebDev/ServerProgramming/ASPNET/export-table-to-excel-with-grid-lines


<cfcontent type="application/vnd.ms-excel">
<html xmlns:x="urn:schemas-microsoft-com:office:excel">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=windows-1252">
<!--[if gte mso 9]>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<!--- //this lines names the worksheet --->
<x:Name>gridlineTest</x:Name>
<x:WorksheetOptions>
<!--- //these 2 lines are what works the magic --->
<x:Panes>
</x:Panes>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
<![endif]-->
</head>
<body>
<table>
<tr><td>ID</td><td>Name</td><td>Balance</td></tr>
<tr><td>1234</td><td>Al Bundy</td><td>45</td></tr>
<tr><td>9876</td><td>Homer Simpson</td><td>-129</td></tr>
<tr><td>5555</td><td>Peter Griffin</td><td>0</td></tr>
</table>
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:PhotoMan2000
ID: 31598994
Worked like a charm!!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Server with multiple sites and SSL 14 66
Help Fix A 403 error 13 107
WAMP server installation, getting error popups, DLLs missing 5 78
DNS, website, godaddy 6 84
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question