473,395 Members | 1,937 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Excel gridlines

Like many people here, I've been trying to generate a spreadsheet on an ASP
page. In my case, it's Intranet, so I can't provide you with a link. But the
problem I have been fighting is a simple one: The spreadsheet that is built
by my code has no gridlines. I cannot find anything in the documentation of
either MSDN (for ASP) or Excel that tells me how to code my page in such a
way that it looks like Excel normally looks when you bring it up.

In my HTML code, I have tried

<table border="1"

as well as just taking the border attribute out. I have seen this work in
other people's ASP code, but don't have access to their code. Any help
appreciated.
Jul 22 '05 #1
5 2491
There's probably a more efficient way to do this these days, but I still
tend to use my old standby:

<style>
TABLE { border-left:1px solid #cccccc; border-top:1px solid #cccccc }
TD { border-right:1px solid #cccccc; border-bottom:1px solid #cccccc }
..noborder { border:0px }
</style>

If you have other tables that you *don't* want the style to apply to, then
depending on which is more work, you can create a separate style and in the
one with less work you can say <table class='noborder'><tr><td
class='noborder'>...</td></tr></table> ... or swap it around and make
..TableBorder and .TDBorder classes.

A

"middletree" <mi********@verywarmmail.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
Like many people here, I've been trying to generate a spreadsheet on an
ASP
page. In my case, it's Intranet, so I can't provide you with a link. But
the
problem I have been fighting is a simple one: The spreadsheet that is
built
by my code has no gridlines. I cannot find anything in the documentation
of
either MSDN (for ASP) or Excel that tells me how to code my page in such a
way that it looks like Excel normally looks when you bring it up.

In my HTML code, I have tried

<table border="1"

as well as just taking the border attribute out. I have seen this work in
other people's ASP code, but don't have access to their code. Any help
appreciated.

Jul 22 '05 #2
Oh and you may want to use

TD,TH {
Jul 22 '05 #3
Thanks; it looks good, and I gave it a try and looks better than what I was
working with after I made my post, so I'll go with it.

You da man!
Jul 22 '05 #4
No problem. A nice added touch is to fine-tune the padding and the typeface
used. More of a CSS question than an ASP one, though...


"middletree" <mi********@verywarmmail.com> wrote in message
news:uz****************@TK2MSFTNGP09.phx.gbl...
Thanks; it looks good, and I gave it a try and looks better than what I
was
working with after I made my post, so I'll go with it.

You da man!

Jul 22 '05 #5

"Aaron Bertrand [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:#4**************@tk2msftngp13.phx.gbl...
No problem. A nice added touch is to fine-tune the padding and the typeface used. More of a CSS question than an ASP one, though...


I realize that, but originally, I was hoping there was a way in ASP to set
some Excel properties.
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: LouV | last post by:
The code below exports a datagrid from a dataset stored in a session variable without a hitch. It prompts the user if they would like to open or save the exported spreadsheet. But when the user...
8
by: ZW | last post by:
Hi there, I use following code to convert a datagrid data to Excel. However, if I use IE to access the page, it opens an empty excel page. If I access it by Netscape, it can open it with excel...
5
by: Terry | last post by:
I am building an ASP.net application which will generate a formatted Excel report. Is there a way I can using the Excel on the client pc? Do I have to do a full install of Excel on the server or...
3
by: Seagull Ng | last post by:
Hello all, I am doing my web-based reporting tool in ASP.Net 2.0 using Visual Web Developer 2005. I try to export my populated gridview to Excel spreadsheet but what I got is just a blank...
2
by: steve02a | last post by:
I'm using the Response.ContentType = "application/vnd.ms-excel" in my web application to export data into a spreadsheet. That works fine and all. My question is: When I export the data and go...
6
by: Michael Groeger | last post by:
Hi, I have an aspx page which generates an excel document and transfers it to the browser as attachment. Normally, once the document is transferred the open save dialog prompts to open or save...
2
by: mike | last post by:
Hi, I have surfed through several posting about exporting gridview to excel and it works great. using the following code... response.Clear() response.ContentType = "application/vnd.ms-excel"...
1
by: elangovan | last post by:
Hi all, I'm exporting a datagrid to an excel file. I'm using the following source code to export. DataTable dt = new DataTable(); DataAccess.StoredProcedure sproc = new...
0
by: =?Utf-8?B?U0NhcnRlcg==?= | last post by:
I am working on a project where I need to create an excel file from our ASP.Net website and have it saved on a Macintosh computer. Currently, it is saving the .xls file just fine on the MAC, but...
3
by: ulai | last post by:
Thanks for your help. It really help to solve my work. But now i have a bigger problem : I had more than 65535 records in gridview divide by 10/pages. And when i tried to export the gridview in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.