VikR Posted February 15, 2009 Share Posted February 15, 2009 I have text in a table header element that is centered correctly in Firefox/XP, Firefox/Mac, and Safari/Mac, but on IE7/XP, it isn't centered. Here's a link to the demo: http://tinyurl.com/c3kj6g The text I am trying to center is "Clear All", "Save This", and "Friendly Helper". (screen shot attached). What is the correct way to get this text to center in IE7? Thanks very much in advance to all for any info. Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/ Share on other sites More sharing options...
noober Posted February 16, 2009 Share Posted February 16, 2009 Just a stab. Did you try adding text-align center to your th "TopOfTable" div? Also, just an fyi, without javascript on you've got various issues, not to mention the problems in IE6. Edit: I didnt notice the text that's there telling me to turn javascript on. Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-763080 Share on other sites More sharing options...
VikR Posted February 16, 2009 Author Share Posted February 16, 2009 Thanks for checking out the page. Yes, I do have text-align: center on my top of table div. That's what's so odd. There's also a notice to IE6 users saying that a later version of IE is required to access the site. It may not show up on the demo, but it's on the live site. Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-763212 Share on other sites More sharing options...
haku Posted February 16, 2009 Share Posted February 16, 2009 That text is centered. You can tell because the centers of all three lines of text line up vertically. If the text wasn't centered, the left edges of the text would all line up vertically. Unless you had it right aligned of course. Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-763223 Share on other sites More sharing options...
VikR Posted February 18, 2009 Author Share Posted February 18, 2009 Yes, it is centered, which makes it even odder that it's on the left of the TH element. It should be centered within the TH element. What is the correct way to fix this? Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-764740 Share on other sites More sharing options...
haku Posted February 18, 2009 Share Posted February 18, 2009 Without code, who can say. Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-764763 Share on other sites More sharing options...
VikR Posted February 18, 2009 Author Share Posted February 18, 2009 The demo page is available at this link: http://tinyurl.com/c3kj6g This is not a live page; it's just to demo the anomaly. Thanks very much in advance for any info! Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-764973 Share on other sites More sharing options...
haku Posted February 18, 2009 Share Posted February 18, 2009 Try applying the text-align:center to that cell specifically, instead of just inheriting it from its parent. Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-764976 Share on other sites More sharing options...
VikR Posted February 18, 2009 Author Share Posted February 18, 2009 I've just applied the following rule to the demo, but it isn't yet working: table.food_planner th#TopOfTable{ text-align: center; } I really thought that would fix it. What could be keeping it from working? Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-765027 Share on other sites More sharing options...
haku Posted February 18, 2009 Share Posted February 18, 2009 Honestly, I have no idea. I stopped using tables when I started using CSS. Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-765150 Share on other sites More sharing options...
jcombs_31 Posted February 18, 2009 Share Posted February 18, 2009 Table Headers will actually center the text by default. Without seeing the rest of you css there is no way to tell what you did wrong. Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-765168 Share on other sites More sharing options...
VikR Posted February 18, 2009 Author Share Posted February 18, 2009 Table Headers will actually center the text by default. Without seeing the rest of you css there is no way to tell what you did wrong. The demo, including the css, is at this link: http://tinyurl.com/c3kj6g Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-765285 Share on other sites More sharing options...
VikR Posted February 18, 2009 Author Share Posted February 18, 2009 A new, fully stripped-down demo, is now at: http://www.flavorzoom.com/anomalies/Table_Header_Anomaly_2/Table_Header_Anomaly.html Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-765322 Share on other sites More sharing options...
jcombs_31 Posted February 18, 2009 Share Posted February 18, 2009 Honestly, I saw the link. I was expecting you to post the relative code for the table and css that goes with it, not expect people to search that ridiculously long style sheet. But, i did take a quick look and would guess that your problem is .spinner_goes_here being set to 100px; Try removing that to humor me. Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-765426 Share on other sites More sharing options...
VikR Posted February 18, 2009 Author Share Posted February 18, 2009 That was it. Thanks very much! Quote Link to comment https://forums.phpfreaks.com/topic/145333-solved-centering-text-in-ie7-th-element/#findComment-765436 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.