PDA

View Full Version : table help please!



LJackson
Oct 11th, 2009, 11:56 PM
Hi All,

ok this should be a basic question for you :) i have never really used tables usually use divs but today im using tables for my login system, the problem is that it doesnt look as i want and it has many validation errors :(

here is the code

<div id="login_div">

<table width="383" border="0" align="center" cellpadding="2" cellspacing="1" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<td colspan="5"><form name="form1" method="post" action="checklogin.php">
<strong>Member Login </strong></td>
</tr>
<tr>
<td width="78" rowspan="5"><img src="mayoshindo_logo.png" alt="mayoshindo_logo" width="110" height="128" /></td>
<td width="78" height="50">Username</td>
<td>:</td>
<td><input name="myusername" type="text" id="myusername" /></td>
</tr>

<tr>
<td height="50">Password</td>
<td height="50">:</td>
<td height="50"><input name="mypassword" type="text" id="mypassword" /></td>
</tr>

<tr>
<td width="78" height="30">&nbsp;</td>
<td width="6" height="30">&nbsp;</td>
<td width="294" height="30"><input type="submit" name="Submit" value="Login" /></td>
</tr>
</form>
</table>
</div>


here are the validation errors

# Error Line 21, Column 92: Attribute "bordercolor" is not a valid attribute

…ing="2" cellspacing="1" bordercolor="#000000" bgcolor="#FFFFFF">



You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
# Error Line 24, Column 41: end tag for "form" omitted, but OMITTAG NO was specified

<strong>Member Login </strong></td>



You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".
# Info Line 23, Column 22: start tag was here

<td colspan="5"><form name="form1" method="post" action="checklogin.php">

# Error Line 44, Column 9: end tag for element "form" which is not open

</form>



The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occurred in a script section of your document, you should probably read this FAQ entry.
# Error Line 24, Column 41: XML Parsing Error: Opening and ending tag mismatch: form line 23 and td

<strong>Member Login </strong></td>


# Error Line 25, Column 9: XML Parsing Error: Opening and ending tag mismatch: td line 23 and tr

</tr>


# Error Line 44, Column 9: XML Parsing Error: Opening and ending tag mismatch: tr line 22 and form

</form>

anyone have any ideas

thanks
Luke

bazz
Oct 12th, 2009, 12:37 AM
if, as it seems, your doctype dictates; you need to remove all that presentational stuff out of the xhtml and into a css file.

You may find the other errors go away then. I haven't seen anything wrong with the closing td tags. Is it possible that the html posted is not actually what the validator is checking?


bazz

LJackson
Oct 12th, 2009, 12:42 AM
hi mate its definatly the correct code however as its on my local host maybe thats half of the problem?

in dreamweaver it does not like the ending tr and td tags in this section

<td colspan="5"><form name="form1" method="post" action="checklogin.php">
<strong>Member Login </strong></td>
</tr>

not sure why though? how does one apply styling to a table in css?

thanks mate
Luke

bazz
Oct 12th, 2009, 12:52 AM
It won;t like that because you are putting a form start 'tag' in one part of a table and not closing it inthe same part. Better to put the form strat, before the tbale and close it after you close the table.

Otherwise, you can pout a form inside a td, provided you do the closing order correctly, ie, close the form inside that td.

Were it my login; I'd go back to working with divs. You could even use the 'definition' tags (or are they called dictionary tags?).



<dl>
<dt>word<dt>
<dd>'definition'</dd>
<dd>another 'defintion'</dd>
</dl>


in your case they could be like this:



<dl>
<dt>Login name</dt>
<dd><input type='text' name='uname'... /></dd>
<dt>pwd:</dt>
<dd><input type='password' name='pwd' /></dd>
</dl>


sorry for the typos. I put my fingers on in the wrong order today. :)
bazz

LJackson
Oct 12th, 2009, 12:54 AM
will try that, thanks mate :)

Scriptet
Oct 12th, 2009, 02:09 AM
Hi All,

ok this should be a basic question for you :) i have never really used tables usually use divs but today im using tables for my login system, the problem is that it doesnt look as i want and it has many validation errors :(

here is the code

If you usually use DIVs, why use tables for this? I don't think this is an appropriate place to use tables anyway, so you're going to more trouble than it's worth.

VIPStephan
Oct 12th, 2009, 12:01 PM
I agree 100% with Scriptet. If you are usually using divs why are you using tables in this case? A table isn’t any more correct here than if you would use it for other presentational stuff.