Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8256137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:45:39+00:00 2026-06-08T01:45:39+00:00

I have a table which looks like this (in html): <div id=product_grid_one> <table> <tr>

  • 0

I have a table which looks like this (in html):

<div id="product_grid_one">
  <table>
    <tr>
      <td>
        <div class="productimage"><img src="images/perfume.jpg" alt="Product Image" /></div>
        <div class="productdescription"><p>Perfume spray bottle</p></div>
        <div class="productprice"><p>$4.99</p></div>
      </td>                
      <td>
        <div class="productimage"><img src="images/perfume.jpg" alt="Product Image" /></div>
        <div class="productdescription"><p>Perfume spray bottle</p></div>
        <div class="productprice"><p>$4.99</p></div>
      </td>                
      <td>
        <div class="productimage"><img src="images/perfume.jpg" alt="Product Image" /></div>
        <div class="productdescription"><p>Perfume spray bottle</p></div>
        <div class="productprice"><p>$4.99</p></div>
      </td>                
      <td>
        <div class="productimage"><img src="images/perfume.jpg" alt="Product Image" /></div>
        <div class="productdescription"><p>Perfume spray bottle</p></div>
        <div class="productprice"><p>$4.99</p></div>
      </td>                
    </tr>              
  </table>
</div>

And here is the CSS for it:

td { width: px; padding: 14px; border: 1px solid #c0c0c0; margin: 14px; }

Basically there is one row with four cells. Each cell has a vertically stacked image,
text description of the product, and product price. Now, around this three-piece stack
I want my td element (which I presume can be treated as a block), to have a padding of
14px, which I can set no problem, so that there is a 1px border 14px away from the
stack of image, text, and price. No problem till here.

The problem is that in the above, the margin is not being set!!@

I could set margin: 200px; and there still would be no difference, the margin is
about 1 or 2 pixels and does not seem to be possible to change this. And I have
tried this on Firefox 13.0.1.

So, how do I set the margin? I would like there to be 14 px between each td in the table.

Can this be attained with CSS?


It has been suggested to use the cellspacing attribute of tables. So I could
make use of the following equivalent CSS:

table { border-collapse: separate; border-spacing: 14px; }

but this is no good to me as I want the border-spacing applied only inside the
table. I do not want any spacing on either side (left or right) of the table as
a whole. Any solutions?


Well, I was able to reach a solution at last. I managed to resolve the issue
with a negative margin so that the border spacing which the table adds around
the table (in addition to in between the various table data and table headers)
does not become visible as it moved out of the way to the left by making use
of the left margin with the negative value.

table { border-collapse: separate; border-spacing: 13px; margin-left: -13px; }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:45:41+00:00Added an answer on June 8, 2026 at 1:45 am

    Could you check if

    .style { border-spacing: 0px; }
    

    produces any difference? When the dinosaurs walked the Earth, they used

    <td cellspacing="0">
    

    but if you do so today, somebody of your colleagues will slap you silly. And if they do, they will probably give you the link to some list of deprecated stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML Data which looks like: <div id=foo><a class=someClass href=http://somelink>Some Title</a></div> <div
i have a html table which looks like this: <table> <thead> <tr> <th >title1</th>
I have a table which looks like this: mysql> SHOW COLUMNS FROM Users; +------------+--------------+------+-----+---------+----------------+
I have a table which looks like this: <table id='t'> <thead> .... </thead> <tbody
I have a table which looks like this one: | id | fk_book |
I have this mysql table called comments which looks like this: commentID parentID type
I have two tables which looks something like this Table Queue int ID; string
I have jQuery code which looks something like this on Button1 Click $('table.result_grid tbody
I have an HTML table that looks like this: ------------------------------------------------- |Column 1 |Column 2
i have a table (tbl_world) which look like this id | first_name | last_name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.