czukoman20 Posted February 29, 2008 Share Posted February 29, 2008 i have this starting code for my .php for some wierd reason, the table doesn't come out flesh with the top of the page. its a half a step down a bit. My code for the table with the start is as follows. (take in consideration that this is a template) <!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 http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- TemplateBeginEditable name="doctitle" --> <title>Adworld-online.com-</title> <!-- TemplateEndEditable --> <script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script> <style type="text/css"> <!-- body { background-image: url(../images/bg.jpg); } body,td,th { font-family: Constantia; } a:link { color: #0000FF; } a:visited { color: #0000FF; } a:hover { color: #0000FF; } a:active { color: #0000FF; } --> </style> <!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable --> <script src="../Scripts/AC_ActiveX.js" type="text/javascript"></script> </head> <body> <table width="673" height="277" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="12" colspan="3"><div align="center"><img src="../images/top.png" width="824" height="12" /></div></td> </tr> <tr> The wierd thing is. I put this in an html file, and its flesh with the top, but the pages that im using calls for php. soo im stuck help is appreciated Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/ Share on other sites More sharing options...
soycharliente Posted March 6, 2008 Share Posted March 6, 2008 Add to the body definition? margin: 0; padding: 0; Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-485432 Share on other sites More sharing options...
haku Posted March 7, 2008 Share Posted March 7, 2008 Zeroing the margin and padding in the body is not recommended, as it makes form elements unpredictable. Much better to use a CSS reset sheet. Yahoo offers a decent one, and there are others out there as well. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-485718 Share on other sites More sharing options...
soycharliente Posted March 7, 2008 Share Posted March 7, 2008 Then wrap the table in a div and add it to that. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-486486 Share on other sites More sharing options...
haku Posted March 8, 2008 Share Posted March 8, 2008 Or just apply it to the table itself. No need for an unnecessary div. Just ads extra unneeded markup. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-486594 Share on other sites More sharing options...
soycharliente Posted March 8, 2008 Share Posted March 8, 2008 Not if he wants to wrap the entire content in a div to apply formatting later if he changes his mind about what's on the page. Go ahead and post again in rebuttal... I'm done here though. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-487151 Share on other sites More sharing options...
haku Posted March 9, 2008 Share Posted March 9, 2008 Wrapping all the content in a div is not a bad idea at all. But wrapping the table alone in a div (like you said the first time) is adding unnecessary markup. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-487703 Share on other sites More sharing options...
bronzemonkey Posted March 9, 2008 Share Posted March 9, 2008 Zeroing the margin and padding in the body is not recommended, as it makes form elements unpredictable. Much better to use a CSS reset sheet. Yahoo offers a decent one, and there are others out there as well. All those resets zero the margin and padding on the body. There is nothing wrong with doing so, in fact, I'd say it is essential in any professional development. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-487723 Share on other sites More sharing options...
haku Posted March 9, 2008 Share Posted March 9, 2008 Its not that it wont work, its just that its unpredictable with form elements. It also goes overboard in that it zeros out things that dont need to be zeroed, slowing down rendering time (apparently). Better to use a reset sheet. Here's a good article on the matter: http://meyerweb.com/eric/thoughts/2007/04/12/reset-styles/ Actually, this guy has written quite a bit on css reset sheets and his stuff is very informative. I recommend giving his site a read through. I personally use a reset sheet based on his with a few minor changes. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-487781 Share on other sites More sharing options...
bronzemonkey Posted March 9, 2008 Share Posted March 9, 2008 Its not that it wont work, its just that its unpredictable with form elements. It also goes overboard in that it zeros out things that dont need to be zeroed, slowing down rendering time (apparently). You mentioned zeroing the body but what you have described is not zeroing the body! That is using the universal selector (*) to zero every element. That definitely is a bad idea. Actually, this guy has written quite a bit on css reset sheets and his stuff is very informative. I think most people know who Eric Meyer is . I use a modified version of his reset too. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-487788 Share on other sites More sharing options...
haku Posted March 9, 2008 Share Posted March 9, 2008 You mentioned zeroing the body but what you have described is not zeroing the body! That is using the universal selector (*) to zero every element. That definitely is a bad idea. Good point! But zeroing out the body is still going to screw with any form elements int eh body. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-487799 Share on other sites More sharing options...
bronzemonkey Posted March 9, 2008 Share Posted March 9, 2008 But zeroing out the body is still going to screw with any form elements int eh body. No it isn't, it is only targeting the body element. Hence why in those resets you specify numerous elements (apart from intra-form elements), and not just the body, that need to be reset. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-487841 Share on other sites More sharing options...
haku Posted March 9, 2008 Share Posted March 9, 2008 My bad, I believe you are entirely right. Quote Link to comment https://forums.phpfreaks.com/topic/93616-tables/#findComment-487856 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.