Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Turn on Grid lines in Excel with ColdFusion

Posted on 2009-07-01
2
Medium Priority
?
1,214 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 1000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
Suggested Courses

721 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