 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
leo99
Joined: 31 Oct 2009 Posts: 5
|
Posted: Sat Oct 31, 2009 4:28 pm *Completely* eliminating space between rows |
|
|
|
I am trying to blend an image in a row that with the background color in the next row:
image
color
the code I am using is something like:
| Quote: |
<table cellspacing="0" cellpadding="0" ... >
........
<tr>
<td colspan="4" valign="bottom">
<img src="images/myimage.png" border="0" alt=" "/>
</td>
</tr>
<tr>
<td colspan="4" bgcolor="#3585D5" valign="top">
........
|
In spite of cellspacing and cellpadding set to 0, I still get a narrow white line between the adjacent rows, so no blending occurs Perhaps I am missing some basics: how can one "blend" two adjacent rows or cells so there is *really* no whitespace between them (but without using rowspan/colspan)? Thanks. |
|
leo99
Joined: 31 Oct 2009 Posts: 5
|
Posted: Sat Oct 31, 2009 6:18 pm |
|
|
|
| I should have mentioned that the problem is specific for IE7 (didn't try IE8); the code works just fine in Firefox 3.0. |
|
leo99
Joined: 31 Oct 2009 Posts: 5
|
Posted: Sun Nov 01, 2009 11:50 am |
|
|
|
Help, anyone ?
The funny thing is that the code works fine in FF, works fine in IE7 at the bottom of the table (i.e. when the row with an image follows the row with a background color). The only place it doesn't work is on top of the table, i.e. when the image goes first and the background next - then IE7 leaves space between the two.
Thanks much,
L. |
|
sticks464

Joined: 31 Dec 2006 Posts: 2627
|
Posted: Sun Nov 01, 2009 12:53 pm |
|
|
|
Add this to your table
| Code: |
| <table cellspacing="0" cellpadding="0" style="border-collapse:collapse;" > |
|
|
leo99
Joined: 31 Oct 2009 Posts: 5
|
Posted: Mon Nov 02, 2009 10:21 am |
|
|
|
Thanks sticks464! I've recently added the border-collapse to the declaration:
| Quote: |
<table cellpadding="0" cellspacing="0" border="0" align="center"
style="border-collapse: collapse; table-layout: fixed; width: 956px;">... |
but unfortunately it didn't help and I still see spacing at the top of my table in IE7...
The funny thing is, the same code works OK at the bottom of that very table (except the background goes first and the image goes second); it also works like charm on both ends of the table if FF...
Very frustrating; perhaps some IE7 specific quirk or "interpretation". Is this the right forum for this kind of inquiries or am I wasting everyone's time?
L. |
|
sticks464

Joined: 31 Dec 2006 Posts: 2627
|
Posted: Mon Nov 02, 2009 11:45 am |
|
|
|
Sounds like you need to zero out browser defaults also. Add this to the head section of your page.
| Code: |
<style type="text/css">
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: top;
}
ol, ul, li {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
</style> |
Leave the inline style for border-collapse in place.
This will basically remove all browser defaults and you will have to specify all margins, padding, borders etc. |
|
sbaetens
Joined: 03 Nov 2009 Posts: 1
|
Posted: Tue Nov 03, 2009 8:47 am |
|
|
|
Hi leo99,
Try this:
| Code: |
<td colspan="4" valign="bottom">
<img src="images/myimage.png" border="0" alt=" "/></td>
|
I know it seems silly but I had the same problem a while back and that did the trick for me. Dont ask me why tho...
Hope it helps.
greets
S. |
|
leo99
Joined: 31 Oct 2009 Posts: 5
|
Posted: Tue Nov 03, 2009 7:06 pm |
|
|
|
| Thanks much sticks464 and sbaetens! I will try both and let you know what came out. |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|