HTML problem - putting a form in a table
#1
Nothing complex, just trying to workout how to get a textbox and submit button inside a table so they're aligned perfectly in the 'horizontal middle' and 'vertical middle'
In a similar way to the search box on the homepage of www.amazon.co.uk
When I try and do it:
<table border=0 width="100%" align="center" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="silver">
<cfform action="home_powders_results.cfm">
Quick Search:
<cfinput type="Text" name="form_quick_search" size=10 required="Yes">
<input type="Submit" size="20" value="GO">
</cfform>
</td>
</tr>
</table>
...the textbox and submit button have an ugly gap beneath them in the row of the table.
Any help would be appreciated. Hope I explained that ok!
In a similar way to the search box on the homepage of www.amazon.co.uk
When I try and do it:
<table border=0 width="100%" align="center" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="silver">
<cfform action="home_powders_results.cfm">
Quick Search:
<cfinput type="Text" name="form_quick_search" size=10 required="Yes">
<input type="Submit" size="20" value="GO">
</cfform>
</td>
</tr>
</table>
...the textbox and submit button have an ugly gap beneath them in the row of the table.
Any help would be appreciated. Hope I explained that ok!
#5
Scooby Regular
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes
on
0 Posts
Daz,
theres probably some hidden setting in CF that is:
PUT_OBSCURE_AND_UNNECESSARY_SPACE_ROUND_CELLS = 1
or something! Can you use a normal form and set its action to a CF page?
Gary
theres probably some hidden setting in CF that is:
PUT_OBSCURE_AND_UNNECESSARY_SPACE_ROUND_CELLS = 1
or something! Can you use a normal form and set its action to a CF page?
Gary
#6
Daz,
Coldfusion is great at sticking boatloads of "white space" into pages, this can be construed as non-breaking spaces by some browsers.
I believe there is a custom tag somwhere called "stripwhitespace" this will remove the junk spce from your document but you MUST have well formed code or else the page WILL fall over.
As Pete says, stick the form outside the table.
I have found that there is very little difference between <form> and <cfform> apart form cfstudio moaning at you....
As for alignment I would specify these as classes in your style sheet, easier to chop and change that way.
Rich
Coldfusion is great at sticking boatloads of "white space" into pages, this can be construed as non-breaking spaces by some browsers.
I believe there is a custom tag somwhere called "stripwhitespace" this will remove the junk spce from your document but you MUST have well formed code or else the page WILL fall over.
As Pete says, stick the form outside the table.
I have found that there is very little difference between <form> and <cfform> apart form cfstudio moaning at you....
As for alignment I would specify these as classes in your style sheet, easier to chop and change that way.
Rich
#7
Seems to do the same when I convert the code to standard HTML...
<table border=1 width="100%" align="center" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" align="center" bgcolor="silver">
<form action="home_powders_results.cfm" method="get">
<input type="submit" name="submit_searchpowders" value="GO" align="left" style="WIDTH: 50px; HEIGHT: 24px">
</form>
</td>
</tr>
</table>
<table border=1 width="100%" align="center" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" align="center" bgcolor="silver">
<form action="home_powders_results.cfm" method="get">
<input type="submit" name="submit_searchpowders" value="GO" align="left" style="WIDTH: 50px; HEIGHT: 24px">
</form>
</td>
</tr>
</table>
Trending Topics
#9
Try this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<table border=1 width="100%" align="center" cellspacing="0" cellpadding="0">
<form action="home_powders_results.cfm" method="get">
<tr>
<td valign="middle" align="center" bgcolor="silver">
<input type="submit" name="submit_searchpowders" value="GO" align="left" style="WIDTH: 50px; HEIGHT: 24px">
</td>
</tr>
</form>
</table>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<table border=1 width="100%" align="center" cellspacing="0" cellpadding="0">
<form action="home_powders_results.cfm" method="get">
<tr>
<td valign="middle" align="center" bgcolor="silver">
<input type="submit" name="submit_searchpowders" value="GO" align="left" style="WIDTH: 50px; HEIGHT: 24px">
</td>
</tr>
</form>
</table>
</body>
</html>
#10
SJ, cheers for that.
I DO need it in a table though as that row has a different background color to emphasize it. I'm sure I've done this before with normal HTML, but I can't get it to work with either method at the moment!
I DO need it in a table though as that row has a different background color to emphasize it. I'm sure I've done this before with normal HTML, but I can't get it to work with either method at the moment!
Thread
Thread Starter
Forum
Replies
Last Post
ATWRX
Full Cars Breaking For Spares
88
01 February 2016 07:28 PM
ossett2k2
Engine Management and ECU Remapping
15
23 September 2015 09:11 AM