473,398 Members | 2,427 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,398 software developers and data experts.

<Form> does not validate depending where it is in the table?

Hi,

This will validate, (http://validator.w3.org/)

<form method="POST" action="" name='xForm' style='background:inherit;'>
<table style='background:inherit; width:100%;'>
<tr width=80%>
<td>
<input type="text" value="search" style="width:100%; text-align:left;">
</td>
<td width=20%>
<input type="submit" value="go" style="width:100%; text-align:left;">
</td>
</tr>
</table>
</form>

But this will not,

<table style='background:inherit; width:100%;'>
<form method="POST" action="" name='xForm' style='background:inherit;'>
<tr width=80%>
<td>
<input type="text" value="search" style="width:100%; text-align:left;">
</td>
<td width=20%>
<input type="submit" value="go" style="width:100%; text-align:left;">
</td>
</tr>
</form>
</table>

(the <form> is inside the <table> tag). Why is it different?

The reason why i ask is because i want to place the valid code above in
another table, (the code above will be a cell of a table), but internet
explorer makes the height of the cell greater. The two inputs are correctly
side by side but if i put the 'valid' code in the cell then the height is
valid.

the cell that are wrong are,

<table style='background:inherit; width:100%;'>
<tr>
<td>Item 1</td>
<td>Item 2</td>
<td>Item 3</td>
<td>Item 4</td>
<td><!-- Valid form --></td>
<tr>
<table>

Many thanks for your input.

Sims
Jul 17 '05 #1
4 2418

"Sims" <si*********@hotmail.com> wrote in message
news:c3*************@ID-162430.news.uni-berlin.de...
Hi,

This will validate, (http://validator.w3.org/)

<form method="POST" action="" name='xForm' style='background:inherit;'>
<table style='background:inherit; width:100%;'>
<snip>
But this will not,

<table style='background:inherit; width:100%;'>
<form method="POST" action="" name='xForm' style='background:inherit;'>
<tr width=80%>
<snip>

This is as it should be.
<form> is simply not something that is part of a table.
http://www.w3.org/TR/REC-html40/struct/tables.html
(the <form> is inside the <table> tag). Why is it different?

The reason why i ask is because i want to place the valid code above in
another table, (the code above will be a cell of a table), but internet
explorer makes the height of the cell greater. The two inputs are correctly side by side but if i put the 'valid' code in the cell then the height is
valid.


<form> has default margin.
Remove it with CSS
--

Karl Groves
http://www.karlcore.com

Jul 17 '05 #2
"Sims" <si*********@hotmail.com> wrote:
This will validate, (http://validator.w3.org/)

<form method="POST" action="" name='xForm' style='background:inherit;'>
<table style='background:inherit; width:100%;'>

</table>
</form>

But this will not,

<table style='background:inherit; width:100%;'>
<form method="POST" action="" name='xForm' style='background:inherit;'> </form>
</table>

(the <form> is inside the <table> tag). Why is it different?
Look at the HTML specification. The only elements that can be direct
children of table are caption, tr, tbody, thead and tfoot.

The form must either surround the whole table, or be contained within
a single table cell.
The reason why i ask is because i want to place the valid code above in
another table, (the code above will be a cell of a table), but internet
explorer makes the height of the cell greater.


By default form elements have a margin. Set this margin to zero in
your CSS and the extra space will porobably vanish (but we can't be
sure because you didn't supply a URL).

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 17 '05 #3

<form method="POST" action="" name='xForm' style='background:inherit;'>
<table style='background:inherit; width:100%;'>


<snip>
But this will not,

<table style='background:inherit; width:100%;'>
<form method="POST" action="" name='xForm' style='background:inherit;'>
<tr width=80%>


<snip>

This is as it should be.
<form> is simply not something that is part of a table.
http://www.w3.org/TR/REC-html40/struct/tables.html


Thanks both of you, (and the others), i didn't know that forms had a margin.
I will change it now.

Many thanks.

Sims
Jul 17 '05 #4
On Tue, 16 Mar 2004 13:30:00 +0200, Sims <si*********@hotmail.com> wrote:
This will validate, (http://validator.w3.org/)
[FORM element outside TABLE]
But this will not,
[FORM element inside TABLE]
(the <form> is inside the <table> tag). Why is it different?
Only certain elements can be a direct child of a TABLE element. These are:
CAPTION, COL, COLGROUP, TBODY, THEAD, TFOOT, and TR[1]. There are
restrictions to how they are used, which are best expressed in the
document type definition.
The reason why i ask is because i want to place the valid code above in
another table, (the code above will be a cell of a table), but internet
explorer makes the height of the cell greater. The two inputs are
correctly side by side but if i put the 'valid' code in the cell then
the height is valid.


IE is adding a margin to the form, which makes the cell taller. Styling
the form with

margin: 0

keeps everything in line.

[snipped containing table]

Mike
[1] If a TR is added without including a TBODY element, the TBODY is
inserted implicitly.

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Keiron Waites | last post by:
I have the following code: <input type="text" name="search" class="search_top"> <a href="" onclick="window.location='search.inc.php'+document..search. value; return false;"...
19
by: Wouter | last post by:
Hi, I try to make when i send a <form> that he dont open a new window. Is there someone who know how i can make this whit javascript ? Greets Wouter
9
by: Warren Post | last post by:
At <http://snow.prohosting.com/srcopan/src/search.html> I have a simple form, using the following code provided by my site search provider: <form method="get"...
6
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to...
4
by: rob c | last post by:
This is a minor thing and only appears in IE (so far), but I'd like to know to correct it (if possible). Whenever I use a form on a webpage, Explorer always leaves a blank line following the...
8
by: chris_fieldhouse | last post by:
Hi fairly new to php, but picking it up quite well. the question I have, is it possible for a php script which is used to validate values submitted in a form, to then post these values onto...
1
by: semifor | last post by:
I've been using a simple technique that works adequately, for me, to restrict a web page to the viewport. A typical page will have a header, a table wrapped in a <divwith "overflow: auto", and...
10
by: neverquit | last post by:
hi , Iam Nagesh,Begineer in using Ajax,well i have been using ajax in application, i have faced a problem while placing the responseTEXT into the <div> tag positioned inside the <form> tag iam...
4
by: Magnus Warker | last post by:
Hello group, I am producing a form within a table: <table> <tr> <td> <form> ... </form>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.