Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Accidently changed the alignment code..
Old 11-23-2009, 10:31 PM Accidently changed the alignment code..
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
This code outputs element_5 ( images from mysql db ) and element_1 ( name of image ) but the output is not to my satisfaction. The images appear, but the text is aligned to the lower right of each image, I want the text to be aligned under the image. I've tried a <td> <br> and not working.

Code:
echo "<table>";
while($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<img src=\"machform/data/form_1/files/".$row['element_5']."\" border=\"1\" alt=\"".$row['element_1']."\" title=\"".$row['element_1']."\">";
echo "<a href=\"$row[element_2]\"> $row[element_1]</a>";
Thanks again
-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-23-2009, 11:18 PM Re: Accidently changed the alignment code..
Banned

Posts: 315
Name: Doug
Trades: 1
You are missing your <TD>

And in order to get the text under the picture you have to do one of two things.
Either <TR> <TD> a separate text row or put a <BR /> after each picture.

The <br /> forces the line feed

Watch out, the purists here will tell you to do the whole thing in CSS.

They can show you how to do that......
marketingman100 is offline
Reply With Quote
View Public Profile
 
Old 11-23-2009, 11:32 PM Re: Accidently changed the alignment code..
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
I added the <td> under the <img tag and the text is now under the image, but the text for both images displayed is under the first image like:

Image Image
text
text

Code:
echo "<table>";
while($row = mysql_fetch_array($result)) {
echo "<tr>"; // This makes creates a row for the images
echo "<img src=\"machform/data/form_1/files/".$row['element_5']."\" border=\"1\" alt=\"".$row['element_1']."\" title=\"".$row['element_1']."\"> ";
echo "<td>";
echo "<a href=\"$row[element_2]\"> $row[element_1]</a>";

}
echo "</table>";
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 11-24-2009, 09:50 AM Re: Accidently changed the alignment code..
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by Paul99 View Post
change text and images possition, first pic than text code
Just tried that, and the images are now aligned one on top of the other (single column, 2 rows) when I want them to be one row then another then another etc...I had it that way yesterday, and accidently screwed it up, and don't remember what I did to screw it up.
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 11-24-2009, 10:53 AM Re: Accidently changed the alignment code..
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
I fixed it just now, for those who would like to know:

Code:
echo "<table>";
while($row = mysql_fetch_array($result)) {
echo "<td>";
echo "<img src=\"machform/data/form_1/files/".$row['element_5']."\" border=\"1\" alt=\"".$row['element_1']."\" title=\"".$row['element_1']."\" <br>";
echo "<div align=\"center\"><a href=\"$row[element_2]\"> $row[element_1]</a>";

}
echo "</td>";
echo "</table>";
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 11-24-2009, 01:07 PM Re: Accidently changed the alignment code..
Junior Talker

Posts: 3
Name: Dave Mader
Location: Tampa Florida
Trades: 0
Why wouldnt you need a <tr> here? Wouldnt that be proper table construction?
DaveM is offline
Reply With Quote
View Public Profile Visit DaveM's homepage!
 
Old 11-24-2009, 01:12 PM Re: Accidently changed the alignment code..
Junior Talker

Posts: 3
Name: Dave Mader
Location: Tampa Florida
Trades: 0
Is this PHP? Sorry Im kinda new
DaveM is offline
Reply With Quote
View Public Profile Visit DaveM's homepage!
 
Old 11-24-2009, 07:19 PM Re: Accidently changed the alignment code..
Banned

Posts: 315
Name: Doug
Trades: 1
It's PHP generating HTML. And yes he needs to make sure his <TR> and </TR> are in place too otherwise some of the browsers will puke the code.
marketingman100 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Accidently changed the alignment code..
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.60856 seconds with 12 queries