Excel gridlines

M

middletree

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.
 
A

Aaron Bertrand [SQL Server MVP]

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
 
M

middletree

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!
 
A

Aaron Bertrand [SQL Server MVP]

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...
 
M

middletree

Aaron Bertrand said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top