DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   HTML and CSS (http://www.daniweb.com/forums/forum143.html)
-   -   Eliminating visible table borders? (http://www.daniweb.com/forums/thread70774.html)

EnderX Feb 22nd, 2007 6:03 pm
Eliminating visible table borders?
 
I built a php-driven form that is intended to have its results printed out and shipped to another location. The results are laid out as a set of tables that hold the information in place. I tested the page on a system wher ethe default browser isFirefox, which displayed the tables without any kind of border. However, when I transfered over to the system which will actually be running the form, I discovered that the default browser there is IE, and that in IE, there are some nasty borders and partial borders (some tables only have one line for the top border, but two for the sides and bottoms) visible, and I'm fairly sure those will be printed out as well. What methods are there to eliminate visible borders from a table that's being displayed in IE?

Thank you for your consideration,
EnderX

MattEvans Feb 23rd, 2007 3:52 am
Re: Eliminating visible table borders?
 
you can turn them off on the table tag itself:

<table border="0"><tr><td>etc</td></tr></table>
(this will turn off the border throughout that table)

or with CSS:

table
{
    border-style:none;
}
(this will disable borders for all tables on a page that includes that rule)

I prefer to do it manually (first example) on all tables, and then turn them on where I want them with CSS.

The partial borders happen when you have cells without data in them.. if you wanted an unbroken border, just put this into otherwise empty cells:
&nbsp;
It will force the cell to 'exist' and be rendered with a proper border.

EnderX Feb 23rd, 2007 10:16 am
Re: Eliminating visible table borders?
 
Thanks for the advice. For some reason the css code didn't want to work right (remember how I said there were two lines in the visible borders? Css code only got rid of one) but the ="0" worked like a charm. Everything appears to be working quite nicely now. Again, thanks.

MidiMagic Feb 27th, 2007 12:30 am
Re: Eliminating visible table borders?
 
To get rid of both lines, you have to set the attribute for both the table and the td tag (and th if you use it).

To remove the space between the borders, use cellspacing="0" in the table tag.


All times are GMT -4. The time now is 6:45 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC