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

Discussion in 'HTML' started by splashedwater@yahoo.com, Jan 31, 2007.

  1. Guest

    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.
     
    , Jan 31, 2007
    #1
    1. Advertising

  2. Scripsit :

    > 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</td> might solve the problem.

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


    Try posting the URL.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Jan 31, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DU
    Replies:
    8
    Views:
    647
    Toby A Inkster
    Oct 8, 2003
  2. mre
    Replies:
    2
    Views:
    449
  3. =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

    Left justified or center justified under XSL:FO

    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=, Feb 9, 2007, in forum: XML
    Replies:
    0
    Views:
    503
    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
    Feb 9, 2007
  4. Rajive Narain
    Replies:
    0
    Views:
    1,989
    Rajive Narain
    Sep 18, 2009
  5. __
    Replies:
    1
    Views:
    126
    Gregor Kofler
    Oct 2, 2007
Loading...

Share This Page