Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-18-2005, 03:08 PM   #1 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,166
Belisarius is on a distinguished road
Getting rid of tables my !@#$

I've been trying to redo some webpages using CSS instead of tables for layout, and it's becoming increasingly frustrating. The pages are forms and form-data, and while there are plenty of examples on how to do the layout of forms in CSS, there aren't any examples on how to layout the resulting form-data in only CSS. At the same time, no one explicitly says not to use CSS for form-data. Grrr . . .
__________________
GitS
Belisarius is offline   Reply With Quote
Old 02-20-2005, 04:16 AM   #2 (permalink)
DavH27
PHP Pilgrim
 
DavH27's Avatar
 
Join Date: Aug 2004
Location: London
Posts: 170
DavH27 is on a distinguished road
Uhrm...okay? Isn't that a journal entry??

Anyway I don't see how you're going wrong. While I've never attempted what you are, I don't see how form parts are treated differently?
__________________
Davy - Programming since 1998 [CV]
Currently working on: n/a
Status: n/a
DavH27 is offline   Reply With Quote
Old 02-20-2005, 07:19 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
what do you mean by 'the resulting form data in only CSS' ?

i stay far away from a 100% CSS layout. too many inconsistancies between browsers.
__________________
Mike
sde is offline   Reply With Quote
Old 02-20-2005, 01:05 PM   #4 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
So the resulting X 'rows' of tabular data will be rendered with CSS instead of tables, eh? I really suck at design, but am trying to use CSS more as I can. Although I still use tables to display rows of data (typically from a DB).

(all the style for the table is based in css though)

-r
idx is offline   Reply With Quote
Old 02-20-2005, 01:47 PM   #5 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,166
Belisarius is on a distinguished road
I mean I have about 30 or so form fields that need to be layed out in a space-efficent form. I had been using a set of nested tables (very, vert nested at times), but I started messing around with CSS and the more I read the more was lamented about using tables to lay things out. I looked at a few examples and though, "Ok, this might do what I need it to". I even looked at some table-less form designs. The problem was that no one showed how to lay out the processed version of the form, the one that doesn't have any "input" fields, just text. I tried to recreate the methods used for form layout, but they failed miserably as the left hand titles didn't line up with multi-row values. Tables handle this automatically, but not the methods employed for table-less CSS apparently.

For example, I have an "address" field. Well, if the address goes on too long, the line wraps down. The only problem is that the title, "Address:" doesn't increase it's space to match, and the result is that "State:" is now directly left of the lower half of the address.

I've been able to get rid of a number of the nested tables, but I don't see how it's possible to completely give up tables on anything but the most simple layouts, that contain only a few elements.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 02-20-2005, 11:53 PM   #6 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Well, I see this as a case of right tool for the right job, tables are still legal html, and no one's asking you to completely ditch tables, the tableless revolution is just about using tables as elements in a page versus the entire page being nothing but tables. When I do my designs I use DIV tags to seperate blocks of content and arrange those with CSS statements, but if the interior of a block requires a table to work properly, so be it.
teknomage1 is offline   Reply With Quote
Old 02-21-2005, 08:46 AM   #7 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
tables for forms is OK

just keep the HTML clean.
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 02-21-2005, 10:13 AM   #8 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
here is a format i like to use for tables with the key name on the left of the input box.
HTML Code:
<form method="POST" action="mypage.php">
<table border="0" cellspacing="1" cellpadding="2">
<!-- example of 1 item of data per row -->
<tr>
  <td align="right">Email</td>
  <td><input type="text" name="email" size="35"></td>
</tr>
<!-- exmple of more than 1 item per row -->
<tr>
  <td align="right">First Name</td>
  <td><input type="text" name="first_name"> &nbsp; 
  Last Name <input type="text" name="last_name"></td>
</tr>
<!-- submit -->
<tr>
  <td align="right">&nbsp;</td>
  <td align="right"><input type="submit" name="btn_submit" value="Submit"></td>
</tr>
</table>
</form>
I know I could do a colspan on the submit line, but IE tends to make all cells the same width if you use a colspan.

here's another one with keynames on top of input boxes.
HTML Code:
<form method="POST" action="mypage.php">
<table border="0" cellspacing="1" cellpadding="2">
<!-- example of 1 item of data per row -->
<tr>
  <td>Email<br><input type="text" name="email" size="35"></td>
</tr>
<!-- exmple of more than 1 item per row -->
<tr>
  <td>
  
  <table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>First Name<br><input type="text" name="first_name"> &nbsp;</td>
    <td>Last Name<br><input type="text" name="last_name"></td>
  </tr>
  </table>
  
  </td>
</tr>
<!-- submit -->
<tr>
  <td align="right"><input type="submit" name="btn_submit" value="Submit"></td>
</tr>
</table>
</form>
i know it has nothing to do with your question since it is nested tables, but just thought i'd share
__________________
Mike
sde is offline   Reply With Quote
Old 02-21-2005, 10:47 AM   #9 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,166
Belisarius is on a distinguished road
Quote:
Originally Posted by teknomage1
Well, I see this as a case of right tool for the right job, tables are still legal html, and no one's asking you to completely ditch tables, the tableless revolution is just about using tables as elements in a page versus the entire page being nothing but tables. When I do my designs I use DIV tags to seperate blocks of content and arrange those with CSS statements, but if the interior of a block requires a table to work properly, so be it.
Yeah, that's what I'm beginning to think as well.
__________________
GitS
Belisarius is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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
Inserting the results of a select query into seperate tables Ste_Boro PHP 1 02-17-2005 05:05 AM
denormalized tables?! WTF?! creed Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 5 09-01-2004 07:19 AM
Generating temporary tables in Access creed Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 0 08-23-2004 02:17 PM
sql question .. joining 3 tables sde PHP 8 03-03-2003 01:12 PM
Preformatted MySQL tables bdl PHP 1 02-17-2003 07:59 PM


All times are GMT -8. The time now is 03:30 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting