How to format text in between left and center (html inside of php).

S

splashedwater

Hi guys, I have a question which is kind of tricky.... I think. I was
wondering how to format text in between left and center. I have an
image (of a product) then under that a price. When I try to center the
text it goes slightly too far to the right (because my image is
slightly off center from my table). Does anyone know how to rememedy
this.

Here is the code,:

<code>
echo "<td border='0' height='168' valign='top' align='left'><a
href='view_print.php?pid=".$row['product_id']."'><img src='uploads/".
$row['image_name']."' alt='".$row['item_name']."'></a><br /><font
size='4'><b><div align='left'>Price: \$".$row['price']. " </div></
b></font></td>";
</code>


You probably have to know php or programming to understand this... but
basically image_name is the image then a <br> then the price which is
currently alligned to the left.

Does this make sense? If not I can clarify.
 
J

Jukka K. Korpela

Scripsit (e-mail address removed):
Hi guys, I have a question which is kind of tricky....

Perhaps. Try posting a URL, and we'll see.
I was wondering how to format text in between left and center.

I can parse the sentence but I cannot make sense of it.
I have an
image (of a product) then under that a price. When I try to center the
text it goes slightly too far to the right (because my image is
slightly off center from my table). Does anyone know how to rememedy
this.

We need to know how you created the problem in order to help you stop doing
that. How about a URL?
Here is the code,:

We want a URL. If relevant, we might later take a look at the code that
generates the HTML code, but the HTML code is really what browsers work on.
They won't even see your PHP code.
<code>
echo "<td border='0' height='168' valign='top' align='left'><a
href='view_print.php?pid=".$row['product_id']."'><img src='uploads/".
$row['image_name']."' alt='".$row['item_name']."'></a><br /><font
size='4'><b><div align='left'>Price: \$".$row['price']. " </div></
b></font></td>";
</code>


You probably have to know php or programming to understand this...

No, you need to post the URL. The snippet isn't enough even to people who
are fluent in all human and non-human languages.

We _can_ see, rather immediately actually, that you generate grossly
malformed (invalid) markup, like a phoney border attribute and an attempt to
nest <div> inside <font>. So why don't you clean up what's really broken
syntactically and _then_ post a URL, if symptoms recur? You might as well
get rid of the <font> markup and use CSS instead.

If you wish to center, why don't you use just align="center" (and not
align="left") in <td>? Using that just with <td ...><img ...><br>Text
here said:
Does this make sense? If not I can clarify.

Try posting the URL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top