Select Categories Below
Advertisement
Start Your Own Q&A Site
Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.
Status: Closed Points: 75 Time: 09:53 - Nov 02, 2007
mary2
I am looking to set a table's cell spacing in CSS, can you show me how that is accomplished?
Categories:
Add Categories
When adding more than one category, separate them with commas.
rcastagna
Date:: Nov 07, 2007
Time:: 07:28
John, Well, the parent container - in your case, the <table> tag has a built-in measure called Cellspacing which renders a pixel void between all cells in the table. If you're looking to just add a bit more "whitespace" to an individual cell, you can look at increasing the padding of that cell, but it may have undesirable effects on the adjoining cells. I hope this helps, Ric
Date:: Nov 08, 2007
Time:: 06:50
Hey Ric, I was hoping that I would just be able to effect the spacing between cells, not the padding. Is there any way to accomplish that with CSS?
Date:: Nov 27, 2007
Time:: 16:01
John, Sadly, the Cellspacing property of the <table> affects the void on all sides of the cell. If you're looking for left and right-side padding, you can do it with CSS by creating a class and using that class on the desired cells. Here's the rub...anything you do that effects the width of one cell, effects the width of all cells above and below it. You may want to look at using a pure CSS solution...if you want to post a code sample, maybe I can help you brew something up. Take care, ric
createusername
Date:: Oct 16, 2010
Time:: 19:57
I see that this question is closed and points have been rewarded and that's fine. I don't know about your point system and don't want any points. However, as I read this, the original question was how to set cell spacing in CSS. The response that "you can do that in your table" was unresponsive to the question. The question was NOT "what are my options for applying cell spacing?" The person asked SPECIFICALLY for how to add cell spacing through CSS. After the pointless discussion, Ric simply deducted that in order to keep the cell spacing from impacting all cells around the specific cell desired, that "You may want to look at using a pure CSS solution." Well, DUH. That is what the original question WAS. The original person posting the question specifically asked for the CSS solution. So, how do you determine this question to be closed when the question asked was never even addressed, but the people who responded addressed the question they apparently THOUGHT should have been asked? And, how do you "award points," which is clearly some kind of reward, to someone who did not provide an answer, but merely confirmed that the person posting the question should look for the answer...IN THE EXACT METHOD he/she was asking about? This is how you people think questions should be asked and answered? What, then, is your purpose?
bob
Date:: Oct 27, 2010
Time:: 19:10
Just looks this up myself. This will give you a similar result as 5px of cell-spacing. table { border-collapse:separate; border-spacing: 5px; } You can set the value to zero that way as well. Or element the spacing by using the collapse property. table { border-collapse:collapse; }
Question Answered
This question has been closed, and points have been rewarded to the following experts:
You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.
Answer this Question
New User
Email:
Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address
Registered User
Username:
Password:
Forgot Your Password?
Enter your email address below and we will resend your login information to you.
Login Information Sent
Questions
How do I set the margin for a Cell in CSS?
How do I set a cell's width in CSS?
How do I get a cell to fill the remainder of a width percentage in HTML table...
You have 100 characters to use
Rank
Expert
Points
1.
10354
2.
6493
3.
5596
4.
4848
5.
3487
6.
2840
7.
2770
8.
2303
9.
1820
10.
917
Register today to share your knowledge with the community and be recognized and rewarded for your contributions.
Register Here
"Psst, Quomon is a great site. Pass it on." Tell a Friend | Link To Us | Save to Delicious | Digg it
Language Options
English:
Español:
Sponsors
Questions and Answers Software