Go Back   Trackpads Community > General Discussions > Computer and Technology > Web Design

Web Design Forums and discussions on webdesign

Web Design

Reply
 
LinkBack Thread Tools
Old 12-19-2004, 22:00   #1 (permalink)
nospam@geniegate.com
Civilians

 
Default CSS and FORM's.

I've actuall never liked tables, but having been critisized for not using them
has gotten me into the bad habit of using tables too much. (I like using
the H* tags)

Now I'm trying to get back to non-tables using CSS, the issue of lining
up form fields has cropped up.

Where I do this in tables:

<TABLE>
<TR><TH COLSPAN="2">My title</TH</TD>
<TR><TH>Field Name</TH><TD><INPUT ...></TD></TR>
<TR><TH>Field Longer Name</TH><TD><INPUT ...></TD></TR>
</TABLE>

I want to do this:

<DIV CLASS="form">
<H2 CLASS="formTitle">My title</H2>
<DIV CLASS="formField"><LABEL>Field Name</LABEL><INPUT ..></DIV>
<DIV CLASS="formField"><LABEL>Field Longer Name</LABEL><INPUT ..></DIV>
</DIV>

So far, so good, but "Field Name" and "Field Longer Name" are jagged and
don't line up with the INPUT/SELECT/TEXTAREA very well. I've tried margins
and padding, but it seems to be very fragile, depending on the longest field
label.

Whats more, in some cases, I don't know the field label lengths or the
type of input element in advance. (They are dynamically generated and
can be multi-line textareas or select boxes.)

Is there a modern CSS way that's as stable as a table when the fields
aren't revealed until the page is displayed?

Jamie
--
http://www.geniegate.com Custom web programming
User Management Solutions Perl / PHP / Java / UNIX

 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Trackpads Information
Click to Visit
Old 12-20-2004, 04:00   #2 (permalink)
Matt Probert
Civilians

 
Default Re: CSS and FORM's.

Once upon a time, far far away, the king summoned nospam@geniegate.com
who replied:

>
>Is there a modern CSS way that's as stable as a table when the fields
>aren't revealed until the page is displayed?


I don't think so, but Grey or Brucie may interject and prove me wrong.

Matt

--
The Probert Encyclopaedia - Beyond Britannica
http://www.probertencyclopaedia.com
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-20-2004, 13:00   #3 (permalink)
GreyWyvern
Civilians

 
Default Re: CSS and FORM's.

On Mon, 20 Dec 2004 07:58:24 GMT, Matt Probert
<comments@probertencyclopaedia.com> wrote:

> Once upon a time, far far away, the king summoned nospam@geniegate.com
> who replied:
>
>>
>> Is there a modern CSS way that's as stable as a table when the fields
>> aren't revealed until the page is displayed?

>
> I don't think so, but Grey or Brucie may interject and prove me wrong.


Forms can be tables if laid out properly. Field label in one column and
input element in the next column. It makes sense. I use it for the input
form for my Forum and Blog scripts:

http://www.greywyvern.com/forum.php#of_postform
http://www.greywyvern.com/blog.php?msg=4#ob_postform

The trouble comes when you start using table cells to place input elements
and field labels in arbitrary locations that only "look" nice and have no
logical order in the source.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- http://www.greywyvern.com - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-20-2004, 13:00   #4 (permalink)
nospam@geniegate.com
Civilians

 
Default Re: CSS and FORM's.

Matt Probert <comments@probertencyclopaedia.com> wrote:
> Once upon a time, far far away, the king summoned nospam@geniegate.com
> who replied:
>
>>
>>Is there a modern CSS way that's as stable as a table when the fields
>>aren't revealed until the page is displayed?

>
> I don't think so, but Grey or Brucie may interject and prove me wrong.


So far, the best I've found is:

<H2>Form title</H2>
<DL>
<DT>Label</DT>
<DD><INPUT|SELECT|TEXTAREA .. ></DD>
</DL>

I kind of like that style, it's what I used to use before tables. Is that
(combined with CSS) something thats comming back into style?

Jamie
--
http://www.geniegate.com Custom web programming
User Management Solutions Perl / PHP / Java / UNIX

 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-20-2004, 16:00   #5 (permalink)
nospam@geniegate.com
Civilians

 
Default Re: CSS and FORM's.

GreyWyvern <spam@greywyvern.com> wrote:
> The trouble comes when you start using table cells to place input elements
> and field labels in arbitrary locations that only "look" nice and have no
> logical order in the source.


Thats the second trouble, it's possible to do forms w/out tables.
Found this article, among others:

http://www.alistapart.com/articles/practicalcss/

It sort of works, assuming it's OK to wrap longer field names. (I believe
it is in this case)

However, when you want to get a little fancier, such as

Action: <SELECT ... /> Id: <INPUT ... /> <INPUT TYPE="SUBMIT" ../>

All on one line, the CSS stuff starts to get mangled, requiring more
cruft in your style sheet to deal with it. (I'd like to make all forms
belong to the same class when possible, otherwise there'll be dozens
of classes to keep track of, making changes difficult)


Jamie
--
http://www.geniegate.com Custom web programming
User Management Solutions Perl / PHP / Java / UNIX

 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing contents of specific cell in form's textbox Mike Microsoft Applications 4 12-10-2004 22:00


Community Information
Options
Quick Options
Trackpads Non-Commercial Ad
Copyright Information Click to Visit
Time
Server Time
All times are GMT -4. The time now is 10:08.
Copyright
Copyright Information
The header is based off of work by Vipixel.com and modified by this site. Trackpads and the Trackpads Logo are both Registered Trademarks of Jason Edwards and cannot be used without prior written permission.  The only exception is as a link back to this site. Trackpads is a private website run by a small legion of volunteers, 3 dogs, 12.5 cats and an army of small, super smart, bio-engineered mice with pointy hats and tutu's. Search Engine Friendly URLs by vBSEO 3.2.0 RC7
Archive Links
Archive Links
Page generated in 0.89418 seconds with 19 queries