Solarpitch Posted October 28, 2006 Share Posted October 28, 2006 Hey Guys,I am developing an application that requires me to pull values from the database and show them up nice and pretty in a table! Ok . . that part is easy, but I want to customize the table.To help explain what I'm on about, www.golftrader.co.uk has a perfect example. As you can see thier on the home page, each add is pulled out in a row and everything seems to be nicely positioned in each row . . ie. . The rows stays a consistent size. . Theres a nice tumbnail displayed with each add. . The text seems to be consistent tooThis is an exact example of the way I would like to implement it in my example! Would any of you guys be able to give me a few tips in being able to achieve this work of art? It's probably easy to you lot! Thanks, Gerard. Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted October 28, 2006 Share Posted October 28, 2006 It's all just html fun at the point you get the variables from the table...You said you had no problem getting the values from the table so I can assume that you just need insight on how to style it? Just plug the variables into fancy html/css![code]$result = mysql_query("SELECT * FROM table");while ($row = mysql_fetch_array($result)) { $imageurl = $row['imageurl']; $title = $row['title']; $author = $row['author']; $date = $row['date']; $description = $row['description']; echo " <div class='container'> <div class='image'><img src='$imageurl' alt='image' /></div> <div class='title'>$title</div> <div class='author'>$author</div> <div class='date'>$date</div> <p class='description'> $description </p> </div>";}[/code]then you would just define the styles for the classes... you could use style tags instead of the classes in the above example... there really isn't much to it... an example of your css file could be like...[code].container { clear:both; border-bottom:1px solid #000000;}.image { float:left; padding:3px; border:1px solid #000000;}.title { font-weight:bold;}[/code]of course there would be more stylings... but your issue isn't near as much PHP as it is html/css tinkering. Quote Link to comment Share on other sites More sharing options...
Solarpitch Posted October 28, 2006 Author Share Posted October 28, 2006 Fair play to you . . I just wansnt really sure where to start messing with the html to get the look I wanted. That code is after helping big time!! Thanks again!Gerard. 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.