Jump to content
tomatoKetchup

Space between cells in a table

Recommended Posts

Hello,

 

I made a table like this :

<table id="floatMenuTable">    <tr>        <td><a href="constitutionLaw.html"><img src="Data/Main/Section1.png"></a></td>        <td></td>    </tr>    <tr>        <td></td>        <td><a href="constitutionLaw.html"><img src="Data/Main/Section2.png"></a></td>    </tr>    <tr>        <td><a href="constitutionLaw.html"><img src="Data/Main/Section3.png"></a></td>        <td></td>    </tr>    <tr>        <td></td>        <td><a href="constitutionLaw.html"><img src="Data/Main/Section4.png"></a></td>    </tr>    <tr>        <td><a href="constitutionLaw.html"><img src="Data/Main/Section5.png"></a></td>        <td></td>    </tr>    <tr>        <td></td>        <td><a href="constitutionLaw.html"><img src="Data/Main/Section6.png"></a></td>    </tr>    </table>

But when I render it on a browser, I get what's in the image attached (the cells have automatically been outlined by the software Brackets).

 

Do you notice the spaces between the cells? Why are they here?

 

I made sure no CSS property make them appear, so why are they still here? Am I missing something?

 

Thanks for your help!

 

Thomas

post-178046-0-63252000-1414596819_thumb.png

Share this post


Link to post
Share on other sites

This will begin to answer your question:

 

http://www.w3schools.com/css/css_boxmodel.asp

 

There's no css in your script. You should do the css tuts. It doesn't appear so.

Edited by niche

Share this post


Link to post
Share on other sites

Tables always have space between the cells by default. You can use the CSS border-spacing property to reduce the space between table cells. You can use border-collapse on the table to make the table cells share the same border.

Share this post


Link to post
Share on other sites

This will begin to answer your question:

 

http://www.w3schools.com/css/css_boxmodel.asp

 

There's no css in your script. You should do the css tuts. It doesn't appear so.

 

Table cells behave differently than the standard box model. The box model only applies to block elements, there are many other rendering modes than block, this is a list of all of them: http://www.w3schools.com/cssref/pr_class_display.asp

Share this post


Link to post
Share on other sites

Thanks for the answers (and sorry for the late reply...).

 

I forgot to say that I had a css file and I had tried different margin a padding properties with the tables as well as border-spacing without any success.

 

However I might have skipped the "border-collapse" one because indeed I got those spaces finally gone after a new attempt. Thank you Ingolme for the tip. ;)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...