AllExperts > Experts 
Search      

Active Server Pages Programming (ASP)

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Active Server Pages Programming (ASP) Answers
Question Library

Ask a question about Active Server Pages Programming (ASP)
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Jeff Allen
Expertise
I can answer basic to intermediate questions related to Classic ASP.I can answer Intermediate to Advanced questions CSS& HTML, and basic questions about JavaScript and Ajax. I can also answer questions related to web page accessibility under US Section 508.

Experience
I have 8 years experience with HTML. I have been developing in ASP, VBScript and CSS for two years each. I also currently work as web developer.

Organizations
IWA-HWG

Education/Credentials
I have a BA in English with minors in Web Design and Scientific and Technical Writing

 
   

You are here:  Experts > Computing/Technology > Business Software > Active Server Pages Programming (ASP) > Add Gridlines in excel in asp.net

Topic: Active Server Pages Programming (ASP)



Expert: Jeff Allen
Date: 10/12/2006
Subject: Add Gridlines in excel in asp.net

Question
Hi,
I have query. How do i insert gridlines to my asp.net page. The scenario is that i have placed a html table in .aspx page with runat="server" attribute. In the backend i have given the content type as application/vnd-xls. When my page runs the html table is rendered but i am unable to get the gridlines of Excel. How do i achieve the same.
Thanks in advance

Answer
If it is an HTML Table why not use a CSS rule todo this for you? Just give your table a class attribute add this rule to your CSS File (if you have one, or directly in the head of the .aspx page in question).

table.exceldata td {border: 1px solid #ccc;}

To use this add a class="exceldata" attribute to the table:
<table class="exceldata" border="0" cellspacing="0" runat="server">
...
...
</table>

If you need to place this rule intheheadof the page in question add the following  just before the closing </head> tag:
<style type="text/css" media="screen">
table.exceldata td {border: 1px solid #ccc;}
</style>

and the table cells shouldbe surrounded by a light grey border.
This should force

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.