473,320 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

html width not working

tolkienarda
316 100+
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("SELECT * 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="#dbb47b">', $row[1], "</td>\n";
echo '<td bgcolor="#f2e1cd"> <input type="text" name="quan" width="10" value="1"></td>', "\n";
echo '<td align="center" bgcolor="#dbb47b">$', $row[2], "</td>\n";
echo '<td align="center" bgcolor="#f2e1cd">$', $row[3], "</td>\n";
echo '<td align="center" bgcolor="#dbb47b">$', $final, "</td>\n";
echo '<td align="center" bgcolor="#f2e1cd">$', $row[5], "</td>\n";
echo '<td align="center" bgcolor="#dbb47b">$', $savings, "</td>\n";
echo "<td bgcolor='#f2e1cd'><input type='submit' value='Calculate'></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

Expand|Select|Wrap|Line Numbers
  1.   <tr><form action="process.php" method="post">
  2. <input type='hidden' name='id' value='2'>
  3. <td align="center" bgcolor="#dbb47b">Letter 1oz</td>
  4. <td bgcolor="#f2e1cd"> <input type="text" name="quan" width="10" value="1"></td>
  5. <td align="center" bgcolor="#dbb47b">$0.312</td>
  6. <td align="center" bgcolor="#f2e1cd">$0.078</td>
  7. <td align="center" bgcolor="#dbb47b">$0.39</td>
  8.  
  9. <td align="center" bgcolor="#f2e1cd">$0.41</td>
  10. <td align="center" bgcolor="#dbb47b">$0.02</td>
  11. <td bgcolor='#f2e1cd'><input type='submit' value='Calculate'></td>
  12. </form>
  13. </tr><tr><form action="process.php" method="post">
  14. <input type='hidden' name='id' value='3'>
  15. <td align="center" bgcolor="#dbb47b">Letter 2oz</td>
  16. <td bgcolor="#f2e1cd"> <input type="text" name="quan" width="10" value="1"></td>
  17. <td align="center" bgcolor="#dbb47b">$0.437</td>
  18. <td align="center" bgcolor="#f2e1cd">$0.078</td>
  19. <td align="center" bgcolor="#dbb47b">$0.515</td>
  20.  
  21. <td align="center" bgcolor="#f2e1cd">$0.58</td>
  22. <td align="center" bgcolor="#dbb47b">$0.065</td>
  23. <td bgcolor='#f2e1cd'><input type='submit' value='Calculate'></td>
  24. </form>
  25. </tr>
  26.  
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

Expand|Select|Wrap|Line Numbers
  1.          <table align="center">
  2.     <tr align="center">
  3.         <td align="center" bgcolor="#dbb47b">Product</td>
  4.         <td align="center" bgcolor="#f2e1cd" width="75">Quantity</td>
  5.         <td align="center" bgcolor="#dbb47b">Postage &amp; <br> Handeling</td>
  6.         <td align="center" bgcolor="#f2e1cd">Postage <br> Application</td>
  7.  
  8.         <td align="center" bgcolor="#dbb47b">Final <br> Cost</td>
  9.         <td align="center" bgcolor="#f2e1cd">1st CL<br>Postal<br>Price</td>
  10.         <td align="center" bgcolor='#dbb47b'>Savings <br> Bottom <br> Line</td>
  11.  
  12.         <td>&nbsp; </td>
  13.     </tr>
  14.  
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
http://www.ambimail.com/interactive_quote.php

thanks

eric
May 25 '07 #1
4 1645
pbmods
5,821 Expert 4TB
Try using style="width:10em;" or style="width:10px;" instead of width="10".
May 25 '07 #2
tolkienarda
316 100+
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
May 25 '07 #3
tolkienarda
316 100+
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
May 25 '07 #4
pbmods
5,821 Expert 4TB
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!
May 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

72
by: Mel | last post by:
Are we going backwards ? (please excuse my spelling...) In my opinion an absolute YES ! Take a look at what we are doing ! we create TAGS, things like <H1> etc. and although there are tools...
0
by: lawrenceS59 | last post by:
Hi all, I'm fairly new to web development so bare with me. The html page that i've created isn't working and i can't figure out why. I'm guessing there are some rules that need to be followed...
0
by: punitshrivastava | last post by:
Hi to All, I am Punit Shrivastava.i created one html page for this i cde like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
2
beacon
by: beacon | last post by:
I'm having trouble with a personal web page that I'm designing for work. I'm not well versed in HTML and could use some assistance. Currently, when I open the browser, the table in the head at the...
2
by: lynx129 | last post by:
Hi there , I have php script that works fine under my server but I dont know how to put the html code inside my site. feedback.html <html dir="rtl"> <head> <title> ????? ??? </title>...
3
by: balurajeev | last post by:
Hii, currently i am working on an apliction(ASP.NET/C#) that creates dynamic html rows which contain six html text boxes and a html dropdowllist. At the time of page load the web page contain six...
7
by: imtmub | last post by:
I have a page, Head tag Contains many Scripts and style sheet for Menu and Page. This code working fine and displaying menus and page as i wanted. Check this page for reference....
7
by: praveenb000 | last post by:
Hi, every one on this forum.... I am new to web designing (using HTML/CSS). i designed a web page using HTML, Css with dream weaver. Here is the code i used for the desinging. it appears well...
2
by: sateeshchandrasanga | last post by:
Hi All, My HTML code is working fine in Firefox.But its not displaying any thing in IE.Can you help me in this problem.And in Google crown its displaying but not properly. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.