View Poll Results: What would you use to lay out a form?

Voters
7. You may not vote on this poll
  • Tables

    1 14.29%
  • CSS, DIVs, all that

    5 71.43%
  • Something else

    1 14.29%
Results 1 to 9 of 9

Thread: HTML Forms - tables or CSS?

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    HTML Forms - tables or CSS?

    When creating a data entry form for a website, would you continue using CSS for layout or would you use a table?

    There are some that say it should be a table because a form is tabular data, but of an interactive nature. There are others who say that it should be created like all other pages with CSS for layout.

    Let's hear your opinions and remember, you're still wrong about what you thought.

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: HTML Forms - tables or CSS?

    For me it totally depends on the output, if I'm doing a quick and functional Admin system for example. I might just use a table, however for front end stuff I've allways used CSS.

    Why? Well to be honest I'm not sure why I suppose it just what I'm used to :-/

    Pino

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: HTML Forms - tables or CSS?

    Hey,

    I am with Pino on this one, I tend to use DIV's and CSS.

    Is this just out of curiosity, or what's going on in the froggy head of yours?

    Gary

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: HTML Forms - tables or CSS?

    Well, I'm on the fence. I think forms are a very special case. Forms are interactive tabular data. But they're also presentation. They're both. I don't agree that it's an XOR between them. I think it's a case of us taking this "Don't use tables! Panic! Hair on fire" thing too far. The entire purpose in the first place was semantics.

    With that in mind, there's also the fact that they are key-value pairs. Your label is the key, the input field is the value. It could therefore also be in a Definition List! (DL, DD, DT) A definition list is, after all, semantic. It's saying "Here is the key, here is the value, I'm a little teapot." And people do use that.

    However, at its core level, the label and its input field are semantic in and of themselves! So if you want to be pedantic about this, you'd say that the label and its input element should not be inside anything else. They should be grouped up in fieldsets - as sets of related fields - and then have styles applied because fieldsets are block level (I think).

    But that's not the case... HTML does mix semantics and layout. That is why I say that everyone is wrong.

    Yes, I do overthink things sometimes... but with good reason. After all, who else but me would save you from inline ASP.NET code?

    I'm therefore of the opinion that all ways of presenting forms are perfectly valid. You can use a table, you can use CSS, you can use DLs, you can use FIELDSETs, you can use the corpse of a jackrabbit if you want.

  5. #5
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    Re: HTML Forms - tables or CSS?

    Several good reasons for using CSS starting with maintainability of code/layout then we have better control when positioning elements. Using CSS can sometimes seem like a good deal of trouble yet once you understand CSS and how various browsers render (or not render) life gets easier.

  6. #6
    Karen Payne MVP kareninstructor's Avatar
    Join Date
    Jun 2008
    Location
    Oregon
    Posts
    6,713

    Re: HTML Forms - tables or CSS?

    Quote Originally Posted by mendhak View Post
    Well, I'm on the fence. I think forms are a very special case. Forms are interactive tabular data. But they're also presentation. They're both. I don't agree that it's an XOR between them. I think it's a case of us taking this "Don't use tables! Panic! Hair on fire" thing too far. The entire purpose in the first place was semantics.

    With that in mind, there's also the fact that they are key-value pairs. Your label is the key, the input field is the value. It could therefore also be in a Definition List! (DL, DD, DT) A definition list is, after all, semantic. It's saying "Here is the key, here is the value, I'm a little teapot." And people do use that.

    However, at its core level, the label and its input field are semantic in and of themselves! So if you want to be pedantic about this, you'd say that the label and its input element should not be inside anything else. They should be grouped up in fieldsets - as sets of related fields - and then have styles applied because fieldsets are block level (I think).

    But that's not the case... HTML does mix semantics and layout. That is why I say that everyone is wrong.

    Yes, I do overthink things sometimes... but with good reason. After all, who else but me would save you from inline ASP.NET code?

    I'm therefore of the opinion that all ways of presenting forms are perfectly valid. You can use a table, you can use CSS, you can use DLs, you can use FIELDSETs, you can use the corpse of a jackrabbit if you want.
    In regards to definition list, seems that many developers are unaware of them and that they are easy to use and formatted. Seems ordered and unordered list appear more mainstream for some reason over DL's.

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: HTML Forms - tables or CSS?

    I don't see a problem with using table to control the layout of the form.... since that's just a small portion of the page. I tend to use CSS for page layouts... but for forms, I've got no qualms about using tables for that portion.

    But seeing as how I'm wrong anyways, use your best judgement.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: HTML Forms - tables or CSS?

    I use a GridView for data entry forms like that, it lets me display multiple records as needed and the inner templates can be skinned with css.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  9. #9
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: HTML Forms - tables or CSS?

    Quote Originally Posted by mendhak View Post
    When creating a data entry form for a website, would you continue using CSS for layout or would you use a table?
    I have been advised that it is a bad idea to use tables for layouts or anything else except data display (or splash pages). That being said I would use css because you will end up with a lot less coding hassles.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width