This question already has answers here:
Form inside a table
(3 answers)
Closed 2 years ago.
form instructions:
the table consist of four columns and six rows.
the form is embedded inside a table
the table consist of two columns and six rows
the text and text box in Column 2, Row2 span four rows
There are two tags used to separate the text and text box
<table>
<form name="application" method="post" action="">
<tr>
<th>Application Form</th>
</tr>
<tr>
<td>First Name<input name="firstname" type="textbox" size="20"</td><br>
<td rowspan="4">Countries and places you wish to visit:<br><br>
<textarea></textarea></td></td>
</tr>
<tr>
<td>Last Name:<input type="textbox" size="20"></td>
</tr>
<tr>
<td>Phone number:<input type="textbox" size="20"></td>
</tr>
<tr>
<td>Email:<input type="textbox" size="20"></td>
</tr>
<tr>
<th colspan="4"><input type="submit" name="submit" id="submit" value="Submit">
<input type="reset" name="reset" id="reset" value="Reset"></th>
</tr>
</form>
I need to make this tableenter image description here
I have modified your codes, please check below:
Move out the form from table;
Add </table>
Adjust the textarea;
<form name="application" method="post" action="">
<table cellpadding="10px">
<tr>
<th>Application Form</th>
</tr>
<tr>
<td>First Name:<input name="firstname" type="textbox" size="20"</td>
<td>Countries and places you wish to visit:</td>
</tr>
<tr>
<td>Last Name:<input type="textbox" size="20"></td>
<td rowspan="3" valign="top">
<textarea></textarea>
</td>
</tr>
<tr>
<td>Phone number:<input type="textbox" size="20"></td>
</tr>
<tr>
<td>Email:<input type="textbox" size="20"></td>
</tr>
<tr>
<th colspan="4">
<input type="submit" name="submit" id="submit" value="Submit">
<input type="reset" name="reset" id="reset" value="Reset">
</th>
</tr>
</table>
</form>
Related
I have a ColdFusion form that I want to update my database. I am using the record ID, but there's a issue. When I type the url - localhost:8500/elephant_shack/update.cfm?record_id=1 I get to the for, but not with the form. I am a totally newbie and am lost!
Any help would be great :)
<!--- form--->
<cfquery name="GetRecordtoUpdate" datasource="elephant_shack">
SELECT *
FROM Richard
WHERE record_id = #URL.record_id#
</cfquery>
<table>
<cfoutput query= "GetRecordtoUpdate">
<form action="update_action.cfm" method="Post">
<tr>
<td width="93">record id:</td>
<td width="286"><input name="record_id" type="text" value="#record_id#" size="25"></td>
</tr>
<tr>
<td width="93">Item:</td>
<td width="286"><input name="item" type="text" value="#item#" size="25"></td>
</tr>
<tr>
<td>Stock:</td>
<td><input name="stock" type="text" value="#stock#" size="12"></td>
</tr>
<tr>
<td>Par:</td>
<td><input name="par" type="text" value="#par#" size="12"></td>
</tr>
<tr>
<td>Order:</td>
<td><input name="order" type="text" value="#order#" size="50"></td>
</tr>
<tr>
<td> </td>
<td><input type="Submit" value="Update Information"></td>
</tr>
</form>
</cfoutput>
</table>
Also, the database is not being updated.
<!--- update form--->
<cfupdate datasource="elephant_shack" tablename="Richard">
In HTML I am making a form where there are 2 tables side by side. In one table all the form <label>/Name/E Mail/Password</label> and in another table I am trying to put the form <inputs> text/email/password to make them look nicely visible.
But when I gave the label Message and <textarea name="Message" rows="1" cols="30"></text area> my whole form layout is getting disturbed due to which I am not able keep my initial labels and inputs aligned.
<form class="" action="index.html" method="post">
<table>
<tr>
<td>
<table>
<tr>
<td>
<label>Name</label>
</td>
</tr>
<tr>
<td>
<label>Email</label>
</td>
</tr>
<tr>
<td>
<label>Password</label>
</td>
</tr>
<tr>
<td>
<label>Message</label>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<input type="text" name="" value="">
</td>
</tr>
<tr>
<td>
<input type="email" name="" value="">
</td>
</tr>
<tr>
<td>
<input type="password" name="" value="">
</td>
</tr>
<tr>
<td>
<textarea name="Message" rows="1" cols="30"></textarea>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
When the labels and inputs are aligned
When the labels and inputs are not aligned
There is no need for the extra table inside of the table, and you are including everything inside of 1 row, which is why its formatted like that.
You shouldn't be using tables for this, not when you have things like CSS Flexbox and CSS Grid. Here is a basic example of using flexbox with a form.
But if you must use a table, try a table format like this ...
<table>
<tr>
<td>label here</td>
<td>form field here</td>
</tr>
<tr>
<td>label here</td>
<td>form field here</td>
</tr>
...
</table>
Here is an example using your code.
<form class="" action="index.html" method="post">
<table>
<tr>
<td>
<label>Name</label>
</td>
<td>
<input type="text" name="" value="">
</td>
</tr>
<tr>
<td>
<label>Email</label>
</td>
<td>
<input type="email" name="" value="">
</td>
</tr>
<tr>
<td>
<label>Password</label>
</td>
<td>
<input type="password" name="" value="">
</td>
</tr>
<tr>
<td>
<label>Message</label>
</td>
<td>
<textarea name="Message" rows="1" cols="30"></textarea>
</td>
</tr>
</table>
</form>
This question already has answers here:
HTML form email using mailto in form action doesnt work in Internet Explorer
(3 answers)
Closed 4 years ago.
I made a simple form to meet the needs on my website. It was as wanted, however, I am not able to use the "mailto" function to send the information provided by the user to my email.
After pressing the "send" button, no action is taken. can anybody help me?
NOTE: The form is HTML-only, no database usage, it's just an e-mail bridge.
<div class ="Formulario">
<div align="center">
<form id="form1" name="formulario" method="post" action="mailto:helpcelere#gmail.com">
<table width="200" height="250" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><input name="txt_nome" type="text" form="form1" placeholder="Nome" /></td>
</tr>
<tr>
<td><input name="txt_titulo" type="text" id="txt_titulo" form="form1" placeholder="Título do problema" titulo="txt_titulo" /></td>
</tr>
<tr>
<td><input name="txt_email" type="text" id="txt_email" form="form1" placeholder="Seu e-mail" email="txt_email" /></td>
</tr>
<tr>
<td><textarea cols="50" rows="8" form="form1" placeholder="Mensagem"></textarea></td>
</tr>
<tr>
<td><input type="submit" form="form1" formaction="mailto:helpcelere#gmail.com" formmethod="POST" value="enviar" /></td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
try this instead
<div class ="Formulario">
<div align="center">
<form id="form1" name="formulario" method="post" action="mailto:helpcelere#gmail.com">
<table width="200" height="250" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><input name="txt_nome" type="text" form="form1" placeholder="Nome" /></td>
</tr>
<tr>
<td><input name="txt_titulo" type="text" id="txt_titulo" form="form1" placeholder="Título do problema" titulo="txt_titulo" /></td>
</tr>
<tr>
<td><input name="txt_email" type="text" id="txt_email" form="form1" placeholder="Seu e-mail" email="txt_email" /></td>
</tr>
<tr>
<td><textarea cols="50" rows="8" form="form1" placeholder="Mensagem"></textarea></td>
</tr>
<tr>
<td><input type="submit" value="enviar" /></td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
The following HTML Code displays input fields for Single Record and provides for saving this Single Record to the Database
<html>
<body>
<form method="post" action="demo_add.asp">
<table>
<tr>
<td>CustomerID:</td>
<td><input name="custid"></td>
</tr><tr>
<td>Company Name:</td>
<td><input name="compname"></td>
</tr><tr>
<td>Contact Name:</td>
<td><input name="contname"></td>
</tr><tr>
<td>Address:</td>
<td><input name="address"></td>
</tr><tr>
<td>City:</td>
<td><input name="city"></td>
</tr><tr>
<td>Postal Code:</td>
<td><input name="postcode"></td>
</tr><tr>
<td>Country:</td>
<td><input name="country"></td>
</tr>
</table>
<br>
<input type="submit" value="Add New">
<input type="reset" value="Cancel">
</form>
</body>
</html>
How is possible to save multiple such records in One Operation?
I am creating a website and the font looks different in IE (it's larger) than it is in Firefox and Chrome. Does anyone know why? And how do I fix it in IE?
Here's my code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<head>
<img src="j0182695_downsized.jpg" alt="Oatmeal Raisin cookies" style="float: left" >
<title> Cameron Cookies </title>
</head>
<body background="back-225.gif">
<h1 style="text-align: center; color: red; font-family: Arial, Helvetica, sans-serif;">Cameron Cookies</h1>
<h2 style="font-style: italic; text-align: center;">The best homemade cookies in New England</h2>
<p style="text-align: center;">99 Sycamore St. Portland, ME 04101 (207) 555-1212</p>
<table width="500" border="0">
<tr>
<td align="center">About Us</td>
<td align="center">Contact Us</td>
<td align="center">Place an Order</td>
<td align="center">Sample Recipe</td>
</tr>
</table>
<form name="Web Order Form" id="Web Order Form">
<!--this is the main table -->
<table border="0" width="65%" cellpadding="2">
<!--Personal Info. table -nested table 1 -->
<tr>
<th colspan="2" align="left">Personal Information</th>
</tr>
<tr>
<td style="width: 5px;"><label for="fname">First Name:</label></td>
<td><input name="fname" id="fname" size="30" type="text" /></td>
</tr>
<tr>
<td><label for="lname">Last Name:</label></td>
<td><input name="lname" id="lname" size="30" type="text" /></td>
</tr>
<tr>
<td><label for="address">Address:</label></td>
<td><input name="address" id="address" size="30" type="text" /></td>
</tr>
<tr>
<td><label for="city">City:</label></td>
<td><input name="city" id="city" size="35" type="text" /></td>
</tr>
<tr>
<td><label for="state">State:</label></td>
<td><input name="state" id="state" size="3" type="text" /></td>
</tr>
<tr>
<td><label for="zip">Zip Code:</label></td>
<td><input name="zip" id="zip" size="10" type="text" /></td>
</tr>
<tr>
<td><label for="country">Country:</label></td>
<td><input name="country" id="country" size="10" type="text" /></td>
</tr>
<!--Order Info. table -nested table 2 -->
<!--This is the first nested table within the main table -->
<table border="2" width="65%" cellpadding="2">
<!--Row 1 -->
<tr>
<th colspan="3" align="left">Order Information</th>
</tr>
<!--Row 2 -->
<tr>
<td width="5">QTY</td>
<td></td>
<td></td>
<td>Subtotal</td>
<td width="75%"><input name="Gift Wrapping" id="Gift Wrapping" type="checkbox" /> Gift wrapping? (Additional charge of 1.95 per box)</td>
</tr>
<!-- Row 3 -->
<tr>
<td><input name="quantitya" id="quantitya" size="3" type="textbox" value="0"/></td>
<td width="50%"></td>
<td width="50%" align="left"><label for="subtotala">Chocolate Nut - $10.99</label></td>
<td><input name="subtotala" id="subtotala" size="10" type="textbox" value="0"/></td>
<td >If yes, note the text for the gift card:</td>
</tr>
<!-- Row 4 -->
<tr>
<td><input name="quantityb" id="quantityb" size="3" type="textbox" value="0"/></td>
<td width="15000"></td>
<td width="15000" align="left"><label for="subtotalb">Chocolate Chip - $9.99</label></td>
<td><input name="subtotalb" id="subtotalb" size="10" type="textbox" value="0"/></td>
<td ><textarea wrap="soft" name="giftcardtext" id="giftcardtext" rows="3" cols="20" ></textarea></td>
</tr>
<!--Row 5 -->
<tr>
<td><input name="quantityc" id="quantityc" size="3" type="textbox" value="0"/></td>
<td width="15000"></td>
<td width="15000" align="left"><label for="subtotalc">Macadamia Nut - $12.99</label></td>
<td><input name="subtotalc" id="subtotalc" size="10" type="textbox" value="0"/></td>
</tr>
<!--Row 6 -->
<tr>
<td><input name="quantityd" id="quantityd" size="3" type="textbox" value="0"/></td>
<td width="15000"></td>
<td width="15000" align="left"><label for="subtotald">Oatmeal Raisin - $10.99</label></td>
<td><input name="subtotald" id="subtotald" size="10" type="textbox" value="0"/></td>
</tr>
<!--Row 7 -->
<tr>
<td><input name="quantitye" id="quantitye" size="3" type="textbox" value="0"/></td>
<td width="15000"></td>
<td width="15000" align="left"><label for="subtotale">Chocolate Dessert - $10.99</label></td>
<td><input name="subtotale" id="subtotale" size="10" type="textbox" value="0"/></td></td>
<td>Shipping:</td>
<td></td>
<td width="15000">$5.95 for 1-5 boxes, $10.95 for five or more boxes</td>
</tr>
<!--Row 8 -->
<tr>
<td><input name="quantityf" id="quantityf" size="3" type="textbox" value="0"/></td>
<td width="15000"></td>
<td width="15000" align="left"><label for="subtotalf">Butter - $7.99</label></td>
<td><input name="subtotalf" id="subtotalf" size="10" type="textbox" value="0"/></td></td>
<td><label for="totala">Total:</label></td>
<td></td>
<td><input name="totala" id="totala" size="3" type="textbox" value="0.00" /></td>
</tr>
<!--Row 9 -->
<tr>
<td></td>
<td width="15000"></td>
<td width="15000" align="left"><label for="subtotalg">Subtotal</label></td>
<td><input name="subtotalg" id="subtotalg" size="10" type="textbox" value="0" /></td></td>
</tr>
</table>
<!--Payment Info. -nested table 3 -->
<!--This is the second nested table within the main table -->
<table border="0" width="65%" cellpadding="2" cellspacing="5">
<!--Row 1 -->
<tr>
<th align="left">Payment Information</th>
</tr>
<!--Row 2 -->
<tr>
<td><input name="Mastercard button" id="Mastercard button" type="radio" />MasterCard</td>
<td><input name="Visa button" id="Visa button" type="radio" />Visa</td>
</tr>
<!--Row 3 -->
<tr>
<td><label for="ccnum">Credit Card Number</label></td>
<td><input name="ccnum" id="ccnum" size="30" type="textbox" /></td>
</tr>
<!--Row 4 -->
<tr>
<td>Expiration</td>
<td><select name="Month" id="Month">
<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>
<select name="year" id="year">
<option>2002</option>
<option>2003</option>
<option>2004</option>
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
<option>2011</option>
<option>2012</option>
</select>
</td>
</tr>
<!--Row 5 -->
<tr>
<td><input name="submit button" id="submit button" type="submit" value="SUBMIT" /></td>
</tr>
</table>
</table>
</form>
Thanks!
Define a font size style:
<style type="text/css">
body{ font-size:medium; }
</style>
You could try to define in pixels too for more consistency:
<style type="text/css">
body{ font-size:10px; }
</style>
Code would go in your html <head>
The fonts are different sizes between the browsers because each uses a different baseline for the default size. You can either choose to live with it (as most users will only use one browser and will therefore only see one size version of the site - not good though if the larger text messes up the layout), or set the baseline font size to the same in each browser.
Have a look at "How to Size Text in CSS". This is quite a good article explaining how to get text to appear the same in different browsers, whilst allowing it to be resized by the user.