i created a php program for an assignment but i want to edit the html page – ive put the form in a table…?
and i basically just want to make the html form look better – i dont have to use css or anything. The code is below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><body bgcolor ="silver">
<h1 align = "center">Mileage</h1>
<form action="processmiles.php" method="post">
<table border = "1", align = "center", CELLPADDING=3>
<tr>
<td> Enter Employee Number: </td>
<td>
<input name="number" type="text" id="number" /> <br/> <br/>
</td>
</tr>
<tr>
<td> Enter Employee Name: </td>
<td>
<input name="name" type="text" id="name" /> <br/> <br/>
</td>
</tr>
<tr>
<td> Enter Employee Phone Number: </td>
<td>
<input name="phone" type="text" id="phone" /> <br/> <br/>
</td>
</tr>
<tr>
<td> Enter miles for journey1: </td>
<td>
<input name="journey1" type="text" id="journey1" /> <br/> <br/>
</td>
</tr>
<tr>
<td> Enter miles for journey2:
</td>
<td> <input name="journey2" type="text" id="journey2" /> <br/> <br/>
</td>
</tr>
<tr>
<td>Enter miles for journey3: </td>
<td>
<input name="journey3" type="text" id="journey3" /> <br/> <br/>
</td>
</tr>
<tr>
<td> Enter miles for journey4:</td>
<td>
<input name="journey4" type="text" id="journey4" /> <br/> <br/>
</td>
</tr>
</table>
<center> <input type="submit" />
</form>
</body></html>
the text box is not really centered with the text opposite.. does anyone know how to do this??
Simplest would be to delete all of the <br/>
If you wanted to improve the usability of your form you might want to add label tags to each of your labels. For example: <label for="number">Enter Employee Number:</label>
If you do that, users of your form will be able to click on one of the labels and the associated input will be activated.
For more on the HTML label tag see: http://www.html-tags-guide.com/html-label-tag.html
BTW, there should be no "," in your table tag, and your document is missing the head section and the required title. A check with http://validator.w3.org/ would probably be in order.
I added a little CSS to your HTML and it worked fine.
<head>
<style type="text/css">
input {
margin-top: 10%;
}
</style>
</head>
References :
Simplest would be to delete all of the <br/>
If you wanted to improve the usability of your form you might want to add label tags to each of your labels. For example: <label for="number">Enter Employee Number:</label>
If you do that, users of your form will be able to click on one of the labels and the associated input will be activated.
For more on the HTML label tag see: http://www.html-tags-guide.com/html-label-tag.html
BTW, there should be no "," in your table tag, and your document is missing the head section and the required title. A check with http://validator.w3.org/ would probably be in order.
References :