Solved

Turn on Grid lines in Excel with ColdFusion

Posted on 2009-07-01
2
1,149 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
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…

948 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now