View Full Version : how do i do this in css?


cyberdread
05-09-2005, 12:34 PM
Tables are not working for me, I was wondering If I could get the same look with CSS?

in mozilla firefox my tables are fine I have border and cellpadding and cellspacing as "0"
But when I view in IE there is a few pixel gap betwwen the rows?
see for yourself:
(both are same)

www.xeracydeproject.com/index.html
www.freewebs.com/x3r4c0m


heres the code i used:

external stylesheet:
_________________
#all
{
width: 886px;
margin: 0 auto
}

htmlpage:
_____________
<html>
<head>
<link href="layout.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#00000000">

<div id="all">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div id="bordh0l">
<img src="multif/h0lb.jpg" width="131" height="654"/>
</div>
<td>
<div id="mainframe">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<object width="654" height="148">
<param name="movie" value="multif/headu.swf">
<embed src="multif/headu.swf" width="654" height="148">
</embed>
</object>
</td>
</tr>
<tr>
<td>
<object width="654" height="375">
<param name="movie" value="audiof/audiou.swf">
<embed src="audiof/audiou.swf" width="654" height="375">
</embed>
</object>
</td>
</tr>
<tr>
<td>
<img src="multif/v3ub.jpg" width="654" height="131"/>
</td>
</tr>
</table>
</div>
</td>
<td>
<div id="bordh0r">
<img src="multif/h0r.jpg" width="131" height="654"/>
</div>
</tr>
</table>
</td>
</div
</body>
</html>

Mano70
05-09-2005, 01:29 PM
I'll give you a general advice in CSS, beware this will reset ALL border, padding, margin and td:

* /*Set's border, padding and margin to 0 for all values*/
{
border: 0;
padding: 0;
margin: 0;
}
html, body {
background: #000;
}
td {
border-collapse: collapse;
}

Now you don't have to use <table border="0" cellspacing="0" cellpadding="0"> and <body bgcolor="#00000000"> anymore.

margin: 0 auto centering don't work properly with IE (it may work if you specify a correct doctype), but to be on the safe side:

html, body {
background: #000;
text-align: center;
}
td {
border-collapse: collapse;
text-align: left;
}

Welcome to the CSS-world.