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
Old 12-13-2009, 01:53 AM Html output help
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Ok, here's the story:

This code does NOT separate the rows, but DOES line up images / text correctly

HTML Code:
echo "<td>";
echo "<img src=\"http://www.webmaster-talk.com/images/$row[element_5]\" border=\"1\" width='$maxwidth' alt=\"$row[element_1]\" title=\"$row[element_1]\">";

echo "<br>";
echo "$row[element_1]</td>";

This code DOES separate the rows, but text DOES NOT line up correctly
HTML Code:
echo "<tr>";
echo "&nbsp;";

echo "<img src=\"http://www.webmaster-talk.com/images/$row[element_5]\" border=\"1\" width='$maxwidth' alt=\"$row[element_1]\" title=\"$row[element_1]\">";
echo "</tr>";
echo "$row[element_1]";
could someone PLEASE get the text to line line up under the image in the second bit of code, I have figured out everything else. Text is element_1. My results have been aligning the text to the left or right of the image...I know it has to do with the <td> and <tr> tags, but like I said, I've been out of it for a long time, and it's beginning to take my love away from it, aka very, very frustrating making the same mistakes over and over for a few weeks in a row.

Of course the data is coming from mysql db.

Appreciate the help!
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 12-13-2009 at 02:18 AM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-13-2009, 05:53 AM Re: Html output help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
A <tr> is meant to contain the cells. IT is NOT a container in it's own right.

<td>s are meant to be contained within <tr>s NOT independent entities.

<tr> == Table ROW which is the row separator.

<td> == Table DATA which is the data container for tabular data

http://www.webmaster-talk.com/html-f...tml#post959642
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-13-2009, 08:10 AM Re: Html output help
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
I understand what the tags are, (I learn them through w3schools) I just don't understand their positioning when it comes to adding them into while loops in php. I even have a complete php reference book in front of me and still having this problem.
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 12-13-2009, 08:26 AM Re: Html output help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Changes in bold
[php]
echo "<tr><td>";
echo "&nbsp;";

echo "<img src=\"http://www.webmaster-talk.com/images/$row[element_5]\" border=\"1\" width='$maxwidth' alt=\"$row[element_1]\" title=\"$row[element_1]\">";
echo "</td><td>";
echo "$row[element_1]";
echo "</td></tr>";
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-13-2009, 08:53 AM Re: Html output help
Novice Talker

Posts: 5
Name: losangelescarrental
Trades: 0
error in tis line: echo "<img src=\"http://www.webmaster-talk.com/images/$row[element_5]\" border=\"1\" width='$maxwidth' alt=\"$row[element_1]\" title=\"$row[element_1]\">";

The correct one should be:
echo "<img src=\"http://www.webmaster-talk.com/images/".$row[element_5]."\" border=\"1\" width='".$maxwidth."' alt=\"".$row[element_1]."\" title=\"".$row[element_1]."\">";
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
losangelescar is offline
Reply With Quote
View Public Profile
 
Old 12-13-2009, 12:04 PM Re: Html output help
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Changes in bold
[php]
echo "<tr><td>";
echo "&nbsp;";

echo "<img src=\"http://www.webmaster-talk.com/images/$row[element_5]\" border=\"1\" width='$maxwidth' alt=\"$row[element_1]\" title=\"$row[element_1]\">";
echo "</td><td>";
echo "$row[element_1]";
echo "</td></tr>";
This code aligns the text to the right of the image ( text is vertically aligned to the center ) I want it under the image and also it's only 1 row going straight down the page.
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 12-13-2009, 12:07 PM Re: Html output help
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by losangelescar View Post
error in tis line: echo "<img src=\"http://www.webmaster-talk.com/images/$row[element_5]\" border=\"1\" width='$maxwidth' alt=\"$row[element_1]\" title=\"$row[element_1]\">";

The correct one should be:
echo "<img src=\"http://www.webmaster-talk.com/images/".$row[element_5]."\" border=\"1\" width='".$maxwidth."' alt=\"".$row[element_1]."\" title=\"".$row[element_1]."\">";
No errors with this ^^ code, just the code above this. Chrishirsts' code.

Thanks
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 12-13-2009, 12:14 PM Re: Html output help
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
I can do it just fine (in basic html) like below: But how can I make it so it loops through the db and displays all images and text from the database looking like below: The output should display image with name under each image going across the page, then create a new line of images when the last image displayed on row 1

HTML Code:
<table>

<tr>

<td>
<img src="image.gif"></td>

</tr>

<tr>

<td>&nbsp;Name:</td>
</tr>

</table>
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 12-13-2009 at 12:16 PM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 12-13-2009, 12:47 PM Re: Html output help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
What you want is actually better done with floated elements NOT a table.

With a table you have to keep a rolling count and "break" the row. Using floats they will simply "wrap" at the container width.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-13-2009, 01:02 PM Re: Html output help
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by chrishirst View Post
What you want is actually better done with floated elements NOT a table.

With a table you have to keep a rolling count and "break" the row. Using floats they will simply "wrap" at the container width.
Isn't that done with css? Can you show me an example of what you mean? I just thought about something, Can't use css for this site, by request. Sorry. I still need a table work around for this project.

Thanks
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 12-13-2009 at 01:21 PM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 12-13-2009, 02:47 PM Re: Html output help
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
check this page out! Exactly what I am trying to accomplish
http://www.wellho.net/demo/sql_image_store.html

REMEMBER mine is contained in a while loop so there will be more images displayed and they need to be across the page, then broken into rows. I know for sure this can be done with the table code modified, I just can't seem to get it right. Notice the text above and below the image? I just need it below the image but in that way.

Please help someone!
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 12-13-2009, 05:12 PM Re: Html output help
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
No other members feel like giving this a shot? I would really like to see this work
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Html output help
 

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 1.12177 seconds with 12 queries