Table not aligning to top of page
04-03-2008, 10:30 AM
|
Table not aligning to top of page
|
Posts: 64
Name: Reggie Byrum
Location: Charlotte, NC
|
I have inserted a table on my home page that I put in a div to control certain aspects of it.
However the table is not appearing right under the copy like it is suppose to . . . there is a LOT of space between the copy and where the table starts.
The site looks fine on a Mac using Safari and Firefox - but you see the space when viewing in Windows on Explorer.
Here's the link to the test page (under development):
http://www.chimneysupply.com/newSite/index.html
Any suggestions?
|
|
|
|
04-03-2008, 12:43 PM
|
Re: Table not aligning to top of page
|
Posts: 1,036
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
There first thing I would do is not use depreciated attributes in XHTML 1.0 Strict mode. These attributes are "width" and "align". It is preferable to do this from the CSS document, but if you must do it this way, change your document type to "transitional". http://validator.w3.org/check?verbos...e%2Findex.html
Last edited by wayfarer07 : 04-03-2008 at 12:44 PM.
|
|
|
|
04-03-2008, 02:41 PM
|
Re: Table not aligning to top of page
|
Posts: 6,554
Location: Tennessee
|
You need the Holly Hack on the div holding the table. Put a height: 1%; on it and the problem goes away.
You should NOT put that into your main css file, you should use conditional comments to call a SEPARATE css file that contains ONLY the properties needed to make IE6 behave.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
|
|
|
|
04-03-2008, 03:04 PM
|
Re: Table not aligning to top of page
|
Posts: 64
Name: Reggie Byrum
Location: Charlotte, NC
|
Quote:
Originally Posted by LadynRed
You need the Holly Hack on the div holding the table. Put a height: 1%; on it and the problem goes away.
You should NOT put that into your main css file, you should use conditional comments to call a SEPARATE css file that contains ONLY the properties needed to make IE6 behave.
|
I'm fairly new at CSS . . . can you give me an example of what you're asking me to do? Thanks!
|
|
|
|
04-03-2008, 03:08 PM
|
Re: Table not aligning to top of page
|
Posts: 6,554
Location: Tennessee
|
You need conditional comments in the <head> of your HTML file, like this:
Quote:
<!--[if lt IE 7]>
<link href="iefixes.css" rel="stylesheet" type="text/css" /> <![endif]-->
<!--[if gt IE 6]>
<link href="ie7fixes.css" rel="stylesheet" type="text/css" /> <![endif]-->
|
Then you need a new css file, my example is called iefixes.css.
In that file you would have ONLY the hacks needed to stop the IE6 bugs, in this case, the Holly Hack (google it !)
#productTable{height: 1%;}
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
|
|
|
|
04-03-2008, 03:14 PM
|
Re: Table not aligning to top of page
|
Posts: 1,036
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
All she is saying to make a conditional comment targeting IE6 that links a stylesheet only to that browser. This code would go in the <head></head> of your document:
<!--[if lte IE 6]><link href="css/ie6.css" type="text/css" rel="stylesheet" /><![endif]-->
Then, in that document:
Code:
div#productTable {
height: 1%;
}
That't it!
Personally, I avoid CCs and use the underscore hack to target IE6, but that is another story.
Last edited by wayfarer07 : 04-03-2008 at 03:17 PM.
|
|
|
|
04-03-2008, 03:15 PM
|
Re: Table not aligning to top of page
|
Posts: 64
Name: Reggie Byrum
Location: Charlotte, NC
|
Thank you, LadynRed!!!!!!!
I really appreciate the help. I'll save the "Holly Hack" in my "Microsoft Weirdo Stuff" folder for future reference. . . :-)
|
|
|
|
04-03-2008, 03:16 PM
|
Re: Table not aligning to top of page
|
Posts: 1,036
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
Oops, looks like you beat me to the punch, Lady  Oh well, I'll leave my comment up anyway...
|
|
|
|
04-03-2008, 03:16 PM
|
Re: Table not aligning to top of page
|
Posts: 6,554
Location: Tennessee
|
You're welcome. You should also go read what's on this site:
www.positioniseverything.net for other IE bug-squashing solutions.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
|
|
|
|
04-03-2008, 03:41 PM
|
Re: Table not aligning to top of page
|
Posts: 64
Name: Reggie Byrum
Location: Charlotte, NC
|
I tried both suggestions and no change . . .
I'm putting
<!--[if lt IE 7]>
<link href="css/iefixes.css" rel="stylesheet" type="text/css" /> <![endif]-->
<!--[if gt IE 6]>
<link href="css/ie7fixes.css" rel="stylesheet" type="text/css" /> <![endif]-->
in my head section of my index page exactly as above.
Then I created a new css file called, "iefixes.css" and put it in my css folder.
Checked on iE6 - no change. I know I'm probably doing something stupid - what am I missing?
|
|
|
|
04-03-2008, 03:44 PM
|
Re: Table not aligning to top of page
|
Posts: 64
Name: Reggie Byrum
Location: Charlotte, NC
|
LadynRed,
I noticed in the code example you gave it made reference to "ie7fixes.css" , which I don't have. Is that suppose to be the name of my regular style sheet (home.css)?
|
|
|
|
04-03-2008, 05:24 PM
|
Re: Table not aligning to top of page
|
Bank holdup redefined....
Posts: 4,714
Name: Tim Daily
Location: Apex, NC, US, Sol 3
|
Nope. That's so if you have any IE7 specific bugs you can put the fixes to them in the named file for it. The css files for the fixes are separate files, and the links to them go after your main style sheet link so those styles override the main one for those particular rules you specified.
The Holly Hack is for IE6 and below only, BTW; IE7 will either ignore or choke on it.
Also, make sure the path you specify in the link href to where your css file is located is valid.
tim 
|
|
|
|
04-03-2008, 07:01 PM
|
Re: Table not aligning to top of page
|
Posts: 1,036
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
I'm not sure if this will work, but try this in the IE6 file, along with the Holly Hack:
Code:
div#productTable {
height: 1%;
overflow: visible;
}
|
|
|
|
04-07-2008, 08:05 AM
|
Re: Table not aligning to top of page
|
Posts: 1,811
Name: carl
Location: UK
|
Quote:
Originally Posted by ncriptide
LadynRed,
I noticed in the code example you gave it made reference to "ie7fixes.css" , which I don't have. Is that suppose to be the name of my regular style sheet (home.css)?
|
The link to 'ie7files.css' is an example only, use whatever names you like to name your stylesheets - just make sure the link points to the right stylesheet.
For EXAMPLE;
you have your main stylesheet 1st (stylesheet.css) then after that you put your conditional statements.
Hope this helps
|
|
|
|
|
« Reply to Table not aligning to top of page
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|