/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Tables and CSS

Okay, first off, I honestly think this warrents a table.

CSS:

[QUOTE]

table{
align: center;
border-width: 1px;
border-style: solid;
border-color: #00ffff;
padding: 0;
margin-top:0;
margin-left:0;
margin-right:0;
margin-bottom:0;
}
td{
margin-top:0;
margin-left:0;
margin-right:0;
margin-bottom:0;
border-width: 1px;
border-style: solid;
border-color: #00ffff;
padding:5px;
}

[/QUOTE]

HTML:

[QUOTE]

<table>
<tr>
<td>MSN</td>
<td>[email protected]</td>
</tr>
<tr>
<td>AIM</td>
<td>Mr Initial Man</td>
</tr>
<tr>
<td>YIM</td>
<td>mrinitialman</td>
</tr>
<tr>
<td>ICQ</td>
<td>147433425 <strong>(I’m rarely on this one)</strong></td>
</tr>
<tr>
<td>E-mail</td>
<td>[email protected]<br>
[email][email protected][/email]</td>
</tr>
</table>

[/QUOTE]

What I am trying to do is close up the space between the cells so their borders are touching.

I also want to center the table. How do I do this?

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@BonRougeOct 22.2004 — Start by putting this stuff together:

border-width: 1px;

border-style: solid;

border-color: #00ffff;

like this : border:1px solid #00ffff;

then replace this :

margin-top:0;

margin-left:0;

margin-right:0;

margin-bottom:0;

with this :

margin: 0 auto; (this should centre your table)

and change this :

padding:5px;

to this:

padding:0px; (this might fix your problem).
Copy linkTweet thisAlerts:
@ray326Oct 22.2004 — Put a border-collapse:collapse; in your table style.
Copy linkTweet thisAlerts:
@Mr_Initial_ManauthorOct 22.2004 — Well, everything worked except your last bit of advice: the <td> padding only controls how close the border is to the text, not how close the cells are to each other. Nor does the centering work in IE.
Copy linkTweet thisAlerts:
@Mr_Initial_ManauthorOct 22.2004 — Thanks, Ray!
×

Success!

Help @Mr_Initial_Man 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.6,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...