Jump to content

Table Spacing


papillonstudios

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.