![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, Since the good support of CSS we shouldn't use tables for layout. And I am quite far in using divs and styling elements to position them without the use of tables. I was wondering how we could layout forms without tables so we would have each input text field below each other. for example: NAME: INPUT FIELD PASSWORD: INPUT FIELD |
#3
| |||
| |||
|
|
Hi, Since the good support of CSS we shouldn't use tables for layout. And I am quite far in using divs and styling elements to position them without the use of tables. I was wondering how we could layout forms without tables so we would have each input text field below each other. for example: NAME: INPUT FIELD PASSWORD: INPUT FIELD Any suggestions? |
#4
| |||
| |||
|
|
NAME: INPUT FIELD PASSWORD: INPUT FIELD I'm of the camp that says that this is a tabular arrangement: labels in one column, user input in another. |
#5
| |||
| |||
|
|
No CSS needed to do this. div><label for="realname">Your Name (required):</label><input type="text" name="realname" id="realname"></div> <div><label for="email">Email Address (required):</label><input type="text" name="email" id="email"></div If you want to put the input field over to a specific spot, try this CSS on the above HTML. form div {position: relative;} form div label {width: 12em;} form div input {position: absolute; left: 13em;} |
#6
| |||
| |||
|
|
Neal wrote: [form layout] No CSS needed to do this. div><label for="realname">Your Name (required):</label><input type="text" name="realname" id="realname"></div> <div><label for="email">Email Address (required):</label><input type="text" name="email" id="email"></div If you want to put the input field over to a specific spot, try this CSS on the above HTML. form div {position: relative;} form div label {width: 12em;} form div input {position: absolute; left: 13em;} Here's me thinking: "this sounds so easy, but I'm sure it was a heck of a lot more complicated when I tried it once" ... Then I realised that was cause I wanted the labels right aligned... :-) |
#7
| |||
| |||
|
|
On 25 Aug 2004 21:38:47 GMT, Els <els.aNOSPAM (AT) tiscali (DOT) nl> wrote: Here's me thinking: "this sounds so easy, but I'm sure it was a heck of a lot more complicated when I tried it once" ... Then I realised that was cause I wanted the labels right aligned... :-) form div {position: relative;} form div label {display: block; width: 10em; text-align: right;} form div input {position: absolute; top: 0; left: 13em;} Works in Opera and IE. |
#8
| |||
| |||
|
|
On Wed, 25 Aug 2004 17:44:13 -0400, Neal neal413 (AT) yahoo (DOT) com> wrote: On 25 Aug 2004 21:38:47 GMT, Els <els.aNOSPAM (AT) tiscali (DOT) nl wrote: Here's me thinking: "this sounds so easy, but I'm sure it was a heck of a lot more complicated when I tried it once" ... Then I realised that was cause I wanted the labels right aligned... :-) form div {position: relative;} form div label {display: block; width: 10em; text-align: right;} form div input {position: absolute; top: 0; left: 13em;} Works in Opera and IE. |
|
Until you change text size in IE, dammit. |
|
This fixes that. form div {position: relative; font-size: 100%;} form div label {display: block; width: 10em; text-align: right;} form div input {font-size: 100%; position: absolute; top: 0; left: 13em;} |
#9
| |||
| |||
|
|
On Wed, 25 Aug 2004 17:17:27 -0400, Harlan Messinger h.messinger (AT) comcast (DOT) net> wrote: NAME: INPUT FIELD PASSWORD: INPUT FIELD I'm of the camp that says that this is a tabular arrangement: labels in one column, user input in another. But isn't the purpose of a table to offer a comparison amongst the data? I think a table needs columns and rows which compare similar data, but this isn't for that purpose really. |
#10
| |||
| |||
|
|
Neal <neal413 (AT) yahoo (DOT) com> wrote: But isn't the purpose of a table to offer a comparison amongst the data? I think a table needs columns and rows which compare similar data, but this isn't for that purpose really. The purpose of a TABLE is to present tabular data. "Data" can be anything, including user-entered data or places for them to enter it. The first paragraph of the Tables section of the spec: "The HTML table model allows authors to arrange data -- text, preformatted text, images, links, forms, form fields, other tables, etc. -- into rows and columns of cells." |
In his honor, I'll start
![]() |
| Thread Tools | |
| Display Modes | |
| |