Is it possible to do cellspacing with CSS? If so, how?
Announcement
Collapse
No announcement yet.
CSS cell-spacing?
Collapse
X
-
Hi Norush
Try this out:
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>index</title> <style type="text/css"> table{width:300px;} td{border:1px solid #000000;margin:10px;padding:5px} </style> </head> <body> <table summary=""> <tr><td>a</td><td>b</td><td>c</td></tr> <tr><td>d</td><td>e</td><td>f</td></tr> <tr><td>g</td><td>h</td><td>i</td></tr> </table> </body> </html>
-
-
-
You now have me totally confused??
Your first question: Is it possible to do cellspacing with CSS? If so, how?
I gave you a tested example.
Your next question: Hmm yea I was just wondering if there's anyway to do cellspacing with CSS... not cellpadding...
The example provided does both
Comment
-
Originally posted by diadesYou now have me totally confused??
Your first question: Is it possible to do cellspacing with CSS? If so, how?
I gave you a tested example.
Your next question: Hmm yea I was just wondering if there's anyway to do cellspacing with CSS... not cellpadding...
The example provided does both
So I ran to check it, and it's looking fine... But it's not working!
You cannot change anything... Try to put 0, 1 ,or even 100 instead of the 10px margin - Nothing! You can even wipe the attribute out, and the look will remain the same... Because it's using the default two pixels cellspacing, and not because of anything too smart... Checked it both in IE6 and Opera, and even Mozilla, just to be sure, and I have no doubt about it now:
There isn't any CSS replacement for the HTML attribute "cellspacing". Use HTML in this case.
Thanks for reading,
Ronny.
Comment
-
Try a mozilla only solution then:
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>index</title> <style type="text/css"> /*<![CDATA[*/ table{width:300px;} tr{height:30px;} table {border:1px solid transparent;border-collapse: separate; border-spacing: 100px 50px;background-color:transparent } td{border:1px solid #000000;width:70px;color:#000000;background-color:#ffffff;padding:15px;} /*]]>*/ </style> </head> <body> <table summary="" cellpadding="0" cellspacing="0"> <tr><td>a</td><td>b</td><td>c</td></tr> <tr><td>d</td><td>e</td><td>f</td></tr> <tr><td>g</td><td>h</td><td>i</td></tr> </table> </body> </html>
Comment
-
Cellspacing can be done in CSS, but is not supported by IE, and some other browsers.
If you want 0 cellspacing, you may use border-collapse: collapse; in CSS, and that will work in IE also. But if you want a value, you will have to use the cellspacing="" attribute in the table tag.
Cellpadding can be done in CSS using padding: xxx;
Comment
Related Topics
Collapse
-
by shiningHi there,
I hope you can give me a hint for the right or missing setting.
The problem is: Every group can see Thumbnails of attachements.... but only the "normal" group...-
Channel: Support Issues & Questions
Sat 18 Mar '17, 9:38am -
-
by mrBjordalIn a new forum post, we created a table with the advanced editor.
Then we added some text in the table and clicked Preview. Everything is good that far.
We clicked Post and the...-
Channel: Support Issues & Questions
Wed 30 Dec '15, 10:47am -
-
I have my "zażółć gęślą jaźń" polish characters in titles, posts etc. And they are not good looking in the browser....
How can i change...-
Channel: Support Issues & Questions
Sun 13 Apr '14, 10:40pm -
Comment