Jump to content

Recommended Posts

I am trying to remove all space between table cells using css. For a navigation bar. that is made up of completely images.

 

Im not sure whats going to but after everything i have tried there is still a 1px space in between each image.

 

what am i not doing?

 

<table>
            	<tr>
                	<td><img src="images/navbar/episodes.png" /></td>
                    <td><img src="images/navbar/videos.png" /></td>
                    <td><img src="images/navbar/news.png" /></td>
                    <td><img src="images/navbar/forums.png" /></td>
                    <td><img src="images/navbar/store.png" /></td>
                    <td><img src="images/navbar/contact.png" /></td>
                    <td><img src="images/navbar/panelRight.png" /></td>
            </table>

 

.navbar {
padding-top:10px;
}

.navbar table {
border-collapse: collapse;
margin-left:auto;
margin-right:auto;
width:auto;
}

.navbar td {
border:0;
margin:0;
}

Link to comment
https://forums.phpfreaks.com/topic/211820-table-spacing/
Share on other sites

If you want the hard fix.

If you assign the images to each TD's background with CSS you can avoid the space. But you have to assign a different  id to each one. Or make a JS function to do it dynamically. If you need help with the JS fix post here i'll se what i can do.

 

I'm currently trying to figure away of doing it with <img>.

Link to comment
https://forums.phpfreaks.com/topic/211820-table-spacing/#findComment-1104125
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.