|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
CSS Cellspacing - Cellpadding
I've been reading on the internet and getting conflicting info. I would like to move the cellspacing and cellpadding attributes into my css sheet. How would I go about this?
<HTML><HEAD><TITLE>TEST</TITLE></HEAD><BODY> <LINK REL=STYLESHEET TYPE=TEXT/CSS HREF=style.css> <BR><CENTER> <TABLE CELLPADDING=0 CELLSPACING=0><TR> <TD><TABLE CELLPADDING=0 CELLSPACING=0><TR> <TD WIDTH=100% COLSPAN=2><IMG SRC=img/header.gif></TD></TR> <TR><TD WIDTH=22% VALIGN=TOP BACKGROUND=img/navbg.gif> <A CLASS=MENU HREF=index.php>Link #1</A><BR> <A CLASS=MENU HREF=index.php>Link #1</A><BR> <A CLASS=MENU HREF=index.php>Link #1</A><BR> <A CLASS=MENU HREF=index.php>Link #1</A><BR> <A CLASS=MENU HREF=index.php>Link #1</A><BR> <BR></TD><TD VALIGN=TOP> CONTENT AREA </TD></TR></TABLE> </TD></TR></TABLE> </CENTER> </BODY> </HTML> Last edited by elevati0n : September 8th, 2002 at 04:54 PM. |
|
#2
|
|||
|
|||
|
<style type="text/css">
<!-- table { padding: 2px; } --> </style> |
|
#3
|
|||
|
|||
|
I've never looked into the CellSpacing before.
Found these: http://selfhtml.teamone.de/css/eige...#border_spacing http://www.milov.nl/forum/1/158 |
|
#4
|
||||
|
||||
|
border-collapse: collapse; /* ie6 ? */
border-spacing: 0; /* px? ns 6? */ This combo got it down to 1px but I still had white space. From what I read the above tags only work with new browsers. CSS has too many quirks. CSS is a great concept but I can't stand the way it's been, being implimented. TABLE.MAIN { margin-top: 0px; margin-left: 0px; margin-right: 0px; margin-bottom: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; padding-bottom: 0px; border-color: black; border-style: solid; border-top-width: 2; border-left-width: 2; border-right-width: 2; border-bottom-width: 2 border-spacing: 0; border-collapse: collapse; } |
|
#5
|
|||
|
|||
|
Quote:
You can narrow all that down into something like this: table.main { margin: 0px; padding: 0px; border: 2px solid black; border-spacing: 0px; border-collapse: collapse; } |
|
#6
|
||||
|
||||
|
no those are just all the tags i tried, still no luck with the cellspacing though.
|
|
#7
|
|||
|
|||
|
Re: CSS Cellspacing - Cellpadding
Quote:
Btw, the link tag is supposed to be in the head tag, not the body tag. |
|
#8
|
||||
|
||||
|
This is the code I use (with formatting taken out, of course
)...TABLE { border-spacing: 0px; border-collapse: collapse; } TD { margin: 5px; padding: 5px; } That works in IE and Netscape. I haven't tried with older browsers, but the newest versions seem as happy as they come with that code. That means you just use 2 lines of code to tell the browsers do have no margins... if it doesn't work in the older browsers, then just chuck in: margin: 0px; or padding: 0px; And one of those 2 will sort it out. I forget which, but one of them will. As long as the browser you're using supports CSS - haha. Remember also that if you just want margins on one side, for example, you can type: margin: 0px; margin-bottom: 5px; So you don't need to type 4 lines of code when 2 will do. Hope I could help! |
|
#9
|
||||
|
||||
|
I use the following. I've yet to find a more complete compilation of CSS properties (aside from MSDN for IE, but that's a pain to use).
CSS Property Index (There's also an HTML index for those interested.) |
|
#10
|
||||
|
||||
|
Maybe Netscape and Microsoft should use this list and save everyone the hassle...
|
|
#11
|
|||
|
|||
|
Quote:
or even 1 line: margin: 0px 0px 2px 0px; (top right bottom left) sorry to bring up an old post, couldn't help helping ![]() |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > CSS Cellspacing - Cellpadding |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|