/    Sign up×
Community /Pin to ProfileBookmark

dealing with cell spacing

in html you can write cellspacing=0, how do you deal with it with CSS? I have margin:0px;border:0px;padding:0px yet i still get spacing between cells… any help?

to post a comment
CSS

9 Comments(s)

Copy linkTweet thisAlerts:
@spufiJan 23.2003 — Post your code, upload a copy of it, or post a link to it.
Copy linkTweet thisAlerts:
@meowJan 23.2003 — You want something like thos for spacing:

border-collapse: separate; border-spacing: .5em

and like this for no spacing:

border-collapse: collapse

Browsers may not obay.

Here you go, have a good read. ?

http://www.w3.org/TR/REC-CSS2/tables.html#borders
Copy linkTweet thisAlerts:
@thejoker101authorJan 23.2003 — http://www.geocities.com/manhattanseniors/17thdegree/template.html

This is the page i'm in the middle of updating to be valid with xhtml 1.0 strict. I figured out how to deal with cellspacing with css only. The only thing is that i checked the pagein NS7.0 and it looks bad. Looks fine in IE6.0 Any help?
Copy linkTweet thisAlerts:
@Robert_WellockJan 23.2003 — You can fiddle my my simple code sample if you want, but remember Micro$oft is not very good at rendering CSS [i]border-spacing[/i].

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Table Spacing</title>
<style type="text/css">
<!--
table {
width : 100%;
border : 1px solid red;
border-spacing : 50px;
padding : 25px;
}
td {
padding : 10px;
color : green;
border : 1px solid blue;
background-color: silver;
}
-->
</style>
</head>
<body>
<table>
<tr>
<td>A</td>
<td>B</td>
</tr>
<tr>
<td>X</td>
<td>Y</td>
</tr>
</table>
</body>
</html>
Copy linkTweet thisAlerts:
@StefanJan 23.2003 — [i]Originally posted by thejoker101 [/i]

This is the page i'm in the middle of updating to be valid with xhtml 1.0 strict[/QUOTE]


Auch, couldn't you have gotten rid of the tables too ?

Anyway, what I really wanted to say was, placing your Javascript in a comment might get you into trouble down the road. In XHTML/XML a comment really IS a comment...

You might as well learn to start placing all your JS linked externally (or simply not comment it at all, that's to work around v3 and older browsers?).

BTW, love your graphics ?
Copy linkTweet thisAlerts:
@thejoker101authorJan 23.2003 — I'm planning on getting rid of the tables once everything else is working properly. I tried earlier on to remove the tables and replace them with <div>'s and <span>'s but i had problems. Admittingly, it was a half-hearted effort, but still.

As you can probably tell, I really don't know much about xhtml. I've been doing most of my coding using html 4.1 strict, but for my newest endeavour decided to go to xhtml 1.0 strict.

Stefan, thanks for your comment about externally linking the javascript. I never really thought about doing it before, but actually it's quite applicable for this website.

And thanks for the comment about the graphics, hopefully it wasn't sarcasm.
Copy linkTweet thisAlerts:
@StefanJan 23.2003 — [i]Originally posted by thejoker101 [/i]

And thanks for the comment about the graphics, hopefully it wasn't sarcasm. [/B][/QUOTE]


It wasn't ?
Copy linkTweet thisAlerts:
@thejoker101authorJan 23.2003 — Well thanks again. I don't really see anything particularly interresting about them, but they work for me. And, seeing how i'm not graphics designer, i was quite happy with them coming out the way they did.
×

Success!

Help @thejoker101 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...