LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Html: Extra Spaces on Top (https://www.linuxquestions.org/questions/programming-9/html-extra-spaces-on-top-70280/)

mikeshn 07-05-2003 09:53 AM

Html: Extra Spaces on Top
 
Any ideas why the form shows extra spaces on top?

<HEAD><TITLE> Form </TITLE> </HEAD>
<?php include 'header.php' ?>
<CENTER>
<form method="POST"action="<?php echo 'index.php'?>">
<table border="1" cellpadding="2" cellspacing="1" width="600" align="top">

<td align="left" valign="top"><font size="0" face="arial, helvetica, sans-serif"><b>Full Name:</b></font> </td><td align="left" valign="top"><input type="text" name="FulName" size=25 maxlength=50></td><BR>
<tr><td align="left" valign="top"><font size="0" face="arial, helvetica, sans-serif"><b>Business:</b></font></td><td align="left" valign="top"><input type="text" name="Business" size=25 maxlength=50></td></tr><BR>

<tr><td align="left" valign="top"><font size="0" face="arial, helvetica, sans-serif"><b>Day Time Phone Number: </b></font></td><td align="left" valign="top"><input type="text" name="DayTimePhoneNumber" size=25 maxlength=50></td></tr><BR>

<tr><td align="left" valign="top"><font size="0" face="arial, helvetica, sans-serif"><b>E-mail:</b></font></td><td align="left" valign="top"><input type="text" name="email" size=25 maxlength=50></td></tr><BR><BR>

<tr><td align="left" valign="top"> <font size="0" face="arial, helvetica, sans-serif"><b> Preferred Condition:</b></font></td> <td align="left" valign="top">

<select name= "Preferred Condition" size=1>
<option value="1">New
<option value="2"> Used
</select></td></tr><BR>

<tr> <td align="left" valign="top"> <font size="0" face="arial, helvetica, sans-serif"><b>Date:</b></font></td>
<td><select name="month" size=1>
<option value="01">January
<option value="02">February
<option value="03">March
<option value="04">April
<option value="05">May
<option value="06">June
<option value="07">July
<option value="08">August
<option value="09">September
<option value="10">October
<option value="11">November
<option value="12">December
</select> <input type="text" name="Day" size=3 maxlength=2>
<select name="Year" size=1>
<option value="2003">2003
<option value="2004">2004
</select></td></tr><BR>

<tr><td align="left" valign="top"><font size="-1" face="arial, helvetica, sans-serif"><b>Just words</b></font>
</td>

<td align="left" valign="top"><input type="radio" name="account" value="Yes"> Yes &nbsp <input type="radio" name="account" value="No"> No</td></tr>
</table><BR>
</form>
</center>

coolman0stress 07-05-2003 03:40 PM

I wish i could just point the error out, but i was just overwhelmed by the amount of errors and omitions you have in your code. So instead of trying to read through it, i instead took the liberty to rewrite that basics of your code in more standard html (following mostly xhtml rules).

Code:

<html>
<head>
        <title>Form</title>
        <style type="text/css">
                body {
                        font-family:  Arial, Helvetica, Sans-serif;
                        }
        </style>
</head>
<body>
        <form method="post">
                <table border="1" cellpadding="2" cellspacing="1" width="600" valign="top">
                        <tr>
                                <td>Full name: </td>
                                <td><input type="text" size="25" maxlength="50"/></td>
                        </tr>
                        <tr>
                                <td>Business: </td>
                                <td><input type="text" size="25" maxlength="50"/></td>
                        </tr>
                        <tr>
                                <td>Day Time Phone Number: </td>
                                <td><input type="text" size="25" maxlength="50"/></td>
                        </tr>
                        <tr>
                                <td>E-mail: </td>
                                <td><input type="text" size="25" maxlength="50"/></td>
       
                        </tr>
                        <tr>
                                <td>Preferred Condition: </td>
                                <td>
                                        <select>
                                                <option>New</option>
                                                <option>Used</option>
                                        </select>
                                </td>
                        </tr>
                        <tr>
                                <td>Date: </td>
                                <td>
                                        <select>
                                                <option>January</option>
                                                <option>February</option>
                                                <option>March</option>
                                                <option>April</option>
                                                <option>May</option>
                                                <option>June</option>
                                                <option>July</option>
                                                <option>August</option>
                                                <option>September</option>
                                                <option>October</option>
                                                <option>November</option>
                                                <option>December</option>
                                        </select>
                                        <input type="text"size=3 maxlength=2/>
                                        <select>
                                                <option>2003</option>
                                                <option>2004</option>
                                        </select>
                                </td>
                        </tr>
                        <tr>
                                <td><b>Just words: </td>
                                <td><input type="radio"/>Yes<input type="radio"/>No</td>
                        </tr>
                </table>
        </form>
</body>
</html>

Things you should look at:
-CSS (cascading style sheets). Move most of your styling code seperate from main html structure code so you can stop using the depricated "font" tag (which will eliminate the need to keep repeating the same thing...). In my rewrite i put one rule at the top of the code in the head (<style type="text/css">...styling rules...</style>. Styling rules are your best friend!
-Don't forget to put all the required html tags, ie <html><head><title></title><body></body></html>

My point is not to bring you down, but with code like this it's really hard to figure out what's actually wrong. So look more into html and css.


All times are GMT -5. The time now is 08:15 PM.