Google Answers Logo
View Question
 
Q: Xhtml ( Answered,   2 Comments )
Question  
Subject: Xhtml
Category: Computers > Graphics
Asked by: kittybooboo-ga
List Price: $10.00
Posted: 24 Feb 2004 17:49 PST
Expires: 25 Mar 2004 17:49 PST
Question ID: 310488
I am still working on the same problem which is setting up a form in
xhtml.  Now I got a great answer, but, I neglected to add it should be
in table form.  Also, it can validate in a transitional doc type.  So
I tried to set up the form and did a good job.  However, I need to get
the first row to right justify.  I'm lost.  How can I get the other
question attached to this one so I will not have to repeat myself. 
Help!!!!!!

Request for Question Clarification by mathtalk-ga on 24 Feb 2004 21:39 PST
[Q: XHTML Help]
http://answers.google.com/answers/threadview?id=310104

Hi, kittybooboo-ga:

Interested readers and researchers can follow the link above to your
previous Question and the Answer that was provided there by
snapanswer-ga.

best wishes, mathtalk-ga
Answer  
Subject: Re: Xhtml
Answered By: snapanswer-ga on 26 Feb 2004 17:42 PST
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<title>Form</title>

<style type="text/css">
   body          {background: white; color: black; margin: 10;}
   table         {border-width: 0;}
   td            {text-align: left;  padding: 4px;}
   td.leftcolumn {text-align: right; padding: 4px;}
</style>

</head>



<body>

<form action="#">


<table border="0">
<tr>
 <td class="leftcolumn">First Name</td>  
 <td><input type="text" name="firstname" size="20" maxlength="20" /></td>
</tr>

<tr>
 <td class="leftcolumn">Last Name</td>  
 <td><input type="text" name="lastname" size="20" maxlength="20" /></td>
</tr>

<tr>
 <td class="leftcolumn">Sex:</td>
 <td>Male<input type="radio" name="sex" value="Male" />  
  Female<input type="radio" name="sex" value="Female" /></td>
</tr>

<tr>
 <td class="leftcolumn">Date of Birth  (MMDDYYYY)</td>
 <td><input type="text" name="dateofbirth" size="8" maxlength="8"  /></td>
</tr>

<tr>
 <td class="leftcolumn">This year my birthday will fall on a:</td>
 <td><input type="text" name="birthdayfalls" size="20" maxlength="20" /></td>
</tr>

<tr>
 <td class="leftcolumn"> </td>
 <td><input type="submit" name="submitbutton" value="Submit" /></td>
</tr>

</table>


</form>

</body>
</html>

Clarification of Answer by snapanswer-ga on 26 Feb 2004 17:51 PST
I have placed the form in a table.  I have also right-aligned the
contents of the left column.  To do that, I have added a <style>
</style> section in the heading of the xHTML document that contains
CSS.  In particular, I have created a class called "leftcolumn" that
allows me to distinguish styles between the left and right columns.

In addition, I have validated the document as strict and transitional
xHTML.  I have placed the transitional DOCTYPE in the document, since
that appeared to be a preference.  However, it will validate using
either DOCTYPE.

W3C Markup Validator
http://validator.w3.org/

Search strategy:  Use xhtml reference materials and the W3C validator
to compose valid xhtml.

Search terms:
xhtml form sample
://www.google.com/search?q=xhtml+form+sample

xhtml transitional strict
://www.google.com/search?q=xhtml+transitional+strict


If you have any questions about this at all, please do not hesitate to
post a clarification request.
Comments  
Subject: Re: Xhtml
From: pinkfreud-ga on 24 Feb 2004 17:52 PST
 
For Researchers:

Here's the earlier question.

http://www.answers.google.com/answers/threadview?id=310104
Subject: Re: Xhtml
From: ivles-ga on 24 Feb 2004 20:53 PST
 
Thanks, pinkfreud-ga

DOCTYPES is something that you seems to be familiar with. The
submitted previous answer means that if it validates strict XHTML
means it will also validates for transitional.

For form, you might want to consider these links:

http://academ.hvcc.edu/~kantopet/xhtml/index.php?page=xhtml+form+basics&parent=xhtml+forms
* not really recommended because it doesn't use any <label> tag, but
it's okay for beginners

http://www.alistapart.com/articles/practicalcss/
* scroll down for the form layouts with CSS

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy