sofia403 Posted May 27, 2011 Share Posted May 27, 2011 hi i was wondering if someone knows how i can position the results that i get in a table in the middle of the cell? thanks echo "<td bgcolor=#EFECE5>" . $row{'field'}."</td>"; Quote Link to comment Share on other sites More sharing options...
sofia403 Posted May 27, 2011 Author Share Posted May 27, 2011 ok nvm i got it figured. thanks Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted May 27, 2011 Share Posted May 27, 2011 ok nevermind i got it figured. thanks apart from the fact that you figured it out, it's always nice to share the solution so others can be helped also, if they were searching for a solution. I assume you used, td{text-align:center;} and if not, i would consider it. Quote Link to comment Share on other sites More sharing options...
sofia403 Posted May 27, 2011 Author Share Posted May 27, 2011 will do. thanks i used this example below. not sure if that's how its done, but it worked for me. "<td bgcolor=#EFECE5 align=center>" . $row{'field'}."</td>"; Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted May 27, 2011 Share Posted May 27, 2011 i was afraid of something like that. apart from the missing quotes around the attribute values, which could cause weird results crossbrowser; the problem with that code is that you make your php more complicated than needed. A good thing to do is to separate concerns (style and logic apart). So separate the css in a different file called a stylesheet. certainly since this is a table cel. can you imagine a table with say 300 cells. you will need to add that align="center" (that's 14 characters times 300, makes 4200 extra characters) instead of just using td{text-align:center;} in a stylesheet Quote Link to comment Share on other sites More sharing options...
sofia403 Posted May 27, 2011 Author Share Posted May 27, 2011 kool thanks! i followed your example. Quote Link to comment 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.