html width not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tolkienarda
    Contributor
    • Dec 2006
    • 316

    html width not working

    hi all
    i am printing out a bunch of html code with a php script and i am not sure if my html syntax or my php syntax, everything works and displays the way i want but the width tags for the text inputs don't work, anyway here is the php code that prints the html
    [PHP]
    $result = mysql_query("SE LECT * FROM costs");
    while ($row = mysql_fetch_row ($result))
    {
    $final = $row[2] + $row[3];
    $savings = $row[5] - $final;
    echo '<tr>';
    echo '<form action="process .php" method="post">' , "\n";
    echo "<input type='hidden' name='id' value='$row[0]'>","\n";

    echo '<td align="center" bgcolor="#dbb47 b">', $row[1], "</td>\n";
    echo '<td bgcolor="#f2e1c d"> <input type="text" name="quan" width="10" value="1"></td>', "\n";
    echo '<td align="center" bgcolor="#dbb47 b">$', $row[2], "</td>\n";
    echo '<td align="center" bgcolor="#f2e1c d">$', $row[3], "</td>\n";
    echo '<td align="center" bgcolor="#dbb47 b">$', $final, "</td>\n";
    echo '<td align="center" bgcolor="#f2e1c d">$', $row[5], "</td>\n";
    echo '<td align="center" bgcolor="#dbb47 b">$', $savings, "</td>\n";
    echo "<td bgcolor='#f2e1c d'><input type='submit' value='Calculat e'></td>\n";

    echo "</form>\n";
    echo '</tr>';
    }
    [/PHP]

    just for ease below is the html that is printed, this is coppied from the Firefox DOM inspector

    [CODE=html]
    <tr><form action="process .php" method="post">
    <input type='hidden' name='id' value='2'>
    <td align="center" bgcolor="#dbb47 b">Letter 1oz</td>
    <td bgcolor="#f2e1c d"> <input type="text" name="quan" width="10" value="1"></td>
    <td align="center" bgcolor="#dbb47 b">$0.312</td>
    <td align="center" bgcolor="#f2e1c d">$0.078</td>
    <td align="center" bgcolor="#dbb47 b">$0.39</td>

    <td align="center" bgcolor="#f2e1c d">$0.41</td>
    <td align="center" bgcolor="#dbb47 b">$0.02</td>
    <td bgcolor='#f2e1c d'><input type='submit' value='Calculat e'></td>
    </form>
    </tr><tr><form action="process .php" method="post">
    <input type='hidden' name='id' value='3'>
    <td align="center" bgcolor="#dbb47 b">Letter 2oz</td>
    <td bgcolor="#f2e1c d"> <input type="text" name="quan" width="10" value="1"></td>
    <td align="center" bgcolor="#dbb47 b">$0.437</td>
    <td align="center" bgcolor="#f2e1c d">$0.078</td>
    <td align="center" bgcolor="#dbb47 b">$0.515</td>

    <td align="center" bgcolor="#f2e1c d">$0.58</td>
    <td align="center" bgcolor="#dbb47 b">$0.065</td>
    <td bgcolor='#f2e1c d'><input type='submit' value='Calculat e'></td>
    </form>
    </tr>
    [/CODE]

    and above all of the php code and fancy stuff is some simple html that starts the table off with some table colom titles here is the code for that

    [CODE=html]
    <table align="center">
    <tr align="center">
    <td align="center" bgcolor="#dbb47 b">Product</td>
    <td align="center" bgcolor="#f2e1c d" width="75">Quan tity</td>
    <td align="center" bgcolor="#dbb47 b">Postage &amp; <br> Handeling</td>
    <td align="center" bgcolor="#f2e1c d">Postage <br> Application</td>

    <td align="center" bgcolor="#dbb47 b">Final <br> Cost</td>
    <td align="center" bgcolor="#f2e1c d">1st CL<br>Postal<br >Price</td>
    <td align="center" bgcolor='#dbb47 b'>Savings <br> Bottom <br> Line</td>

    <td>&nbsp; </td>
    </tr>
    [/CODE]
    Note: this is the same table and is actualy above all that other stuff

    if you would like to see the live version of this here is a link


    thanks

    eric
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Try using style="width:10 em;" or style="width:10 px;" instead of width="10".

    Comment

    • tolkienarda
      Contributor
      • Dec 2006
      • 316

      #3
      hmm that didn't seem to work and i am starting to wonder if the problem is elsewhere in my html code because no width attributes seem to work, that is i have tried to resize the <td>'s to force the size of the inputs down but that didn't work either.

      eric

      Comment

      • tolkienarda
        Contributor
        • Dec 2006
        • 316

        #4
        wait ignore that last staement my stupidty is boundless i frogot to re upload the file after i made that change
        thanks a million for the advice

        eric

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          Did I ever tell you about the time when I downloaded a backup copy of the site we were working on, synced all the changes (this was before we had version control on our server), uploaded the new version and deleted the backup copy... and then found out that I had actually deleted the synced copy and re-uploaded the original!

          If not, I just did. A month later, it's a miracle that pbmods still has a job!

          Glad to hear that you got your issue hammered out. Keep 'em coming!

          Comment

          Working...