|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
HTML - Problem with a Table
Hi,
I have a problem with a Table, I'm sure this is a simple error, but i've spent hours trying to sort it and can't. I'm trying to create 3 Cells, each with rounded edges and red stripes along the top and bottom. So I've created a table 9 x 9 and inserted an image in the top and bottom cells showing rounded edges. I've put all padding and spacing to 0 and it looks good..... In internet exporer 8. If i view it in IE 7 or 'Compatability mode on IE8' it inserts a gap between my cells vertically. you can see it HERE I am very new to CSS, I wrote a website a few years ago, and I am re-building it, as its a bit unstable. oh, and i'm using Expresions if that helps any. This is my code Code:
<style type="text/css">
.style1 {
background-color: #000000;
}
.style3 {
background-color: #000000;
color: #FFFFFF;
}
.style4 {
color: #FFFFFF;
}
.style5 {
text-align: center;
}
</style>
</head>
<body>
<table cellspacing="0" style="width: 750px; height: 244px;" align="center" cellpadding="0">
<tr>
<td class="style5" style="width: 149px; height: 21px">
<img alt="" height="21" src="red_upper.jpg" width="150"/></td>
<td style="width: 5px; height: 21px"></td>
<td style="height: 21px"></td>
<td style="width: 5px; height: 21px"></td>
<td style="width: 150px; height: 21px">
<img alt="" height="21" src="red_upper.jpg" width="150" /></td>
</tr>
<tr>
<td class="style1" style="width: 149px"><br class="style4" />
<br class="style4" />
<span class="style4">Button Window</span><br class="style4" />
<br class="style4" />
</td>
<td style="width: 5px"></td>
<td class="style1"><br class="style4" />
<br class="style4" />
<span class="style4">Main Text Area</span></td>
<td class="style4" style="width: 5px"></td>
<td class="style3" style="width: 150px">Left window</td>
</tr>
<tr>
<td style="height: 21px; ">
<img alt="" height="21" src="red_Lower.jpg" width="150" /></td>
<td style="height: 21px"> </td>
<td style="height: 21px"> </td>
<td style="height: 21px"> </td>
<td style="height: 21px">
<img alt="" height="21" src="red_Lower.jpg" width="150" /></td>
</tr>
</table>
any help or advice would be great Thanks in advance Tony |
|
#2
|
|||
|
|||
|
ahhh,
I think I've sorted it now. I just set the vertical alignment to bottom and top for images. But the table still adjusts its self a little when I change compatability on IE8, is this normal ? |
|
#3
|
|||
|
|||
|
It's there because...
If I understand correctly, the vertical gap is there because you told it to be there. You have a five column table, and you have three columns (1, 3, 5) with something displayed, and two columns (2, 4) with nothing in them. If you want to get rid of the vertical gaps, try this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="en-gb" http-equiv="Content-Language" />
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />
<title>Untitled 1</title>
<style type="text/css">
.style1 { background-color: #000000; }
.style3 { background-color: #000000; color: #FFFFFF; }
.style4 { color: #FFFFFF; }
</style>
</head>
<body>
<table cellspacing="0" style="width: 750px; height: 244px;" align="center" cellpadding="0">
<tr>
<td style="width: 149px; height: 21px" valign="bottom">
<img alt="" height="21" src="red_upper.jpg" width="150"/>
</td>
<td style="height: 21px"></td>
<td style="width: 150px; height: 21px" valign="bottom">
<img alt="" height="21" src="red_upper.jpg" width="150" />
</td>
</tr>
<tr>
<td class="style1" style="width: 149px"><br class="style4" />
<br class="style4" />
<span class="style4">Button Window</span><br class="style4" />
<br class="style4" />
</td>
<td class="style1"><br class="style4" />
<br class="style4" />
<span class="style4">Main Text Area</span>
</td>
<td class="style3" style="width: 150px">Left window</td>
</tr>
<tr>
<td style="height: 21px; " valign="top">
<img alt="" height="21" src="red_Lower.jpg" width="150" />
</td>
<td style="height: 21px"> </td>
<td style="height: 21px" valign="top">
<img alt="" height="21" src="red_Lower.jpg" width="150" />
</td>
</tr>
</table>
</body>
</html>
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > HTML - Problem with a Table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|