473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Is it possible to keep this on the same horizontal?

Hi,

Maybe I should break down and use tables, but I wanted to query the
experts first. Below, I would like the words "First name" and "Last
Name" to appear on the same horizontal and I would like the text
fields to appear on the same horizontal. But I would like the words
to appear above the text fields. The below creates four different
lines:

<div>
<p><label for="user_ship_to_first_name">First name</label><br/>
<input id="user_ship_to_first_name" name="user[ship_to_first_name]"
size="30" type="text" /></p>

<p><label for="user_ship_to_last_name">Last name</label><br/>
<input id="user_ship_to_last_name" name="user[ship_to_last_name]"
size="30" type="text" /></p>
</div>

Is there any way to do what I'm asking without tables? Thanks, - Dave
Feb 15 '08 #1
2 1763
On Fri, 15 Feb 2008 19:33:22 +0100, laredotornado
<la***********@zipmail.comwrote:
Hi,

Maybe I should break down and use tables, but I wanted to query the
experts first. Below, I would like the words "First name" and "Last
Name" to appear on the same horizontal and I would like the text
fields to appear on the same horizontal. But I would like the words
to appear above the text fields. The below creates four different
lines:

<div>
<p><label for="user_ship_to_first_name">First name</label><br/>
<input id="user_ship_to_first_name" name="user[ship_to_first_name]"
size="30" type="text" /></p>

<p><label for="user_ship_to_last_name">Last name</label><br/>
<input id="user_ship_to_last_name" name="user[ship_to_last_name]"
size="30" type="text" /></p>
</div>

Is there any way to do what I'm asking without tables? Thanks, - Dave
With a lot of fiddling & floating(needed for exact size, inline-block is
not supported enough) &setting exact sizes (preferable would be in em) on
the elements offcourse it would be possible. However, it seems perfectly
justifiable to me to have a row with heading (the labels), and a
row/multiple rows with values (the inputs) as a table. To many people,
wether or not a form like this can be in a table seems an edge case, I'd
say it's very defendable here.
--
Rik Wasmus
Feb 15 '08 #2
Scripsit laredotornado:
Below, I would like the words "First name" and "Last
Name" to appear on the same horizontal and I would like the text
fields to appear on the same horizontal.
Stop wanting that. It's against accessibility principles. Although this
is a fairly simple case, it's still wrong. Consider a person using a
speech browser: only after hearing a list of labels would he be prompted
for input. The <labelmarkup might help him, but just might. There's a
simple way to avoid the problems: put a label and the corresponding
field on one line, with nothing more on that line. (You can use a table
to arrange several such lines in a tabular manner, but that's a
different issue.)
<p><label for="user_ship_to_first_name">First name</label><br/>
<input id="user_ship_to_first_name" name="user[ship_to_first_name]"
size="30" type="text" /></p>

<p><label for="user_ship_to_last_name">Last name</label><br/>
<input id="user_ship_to_last_name" name="user[ship_to_last_name]"
size="30" type="text" /></p>
</div>
The size attributes convey a wrong message visually. Two equally wide
fields suggest comparable data. However, as a rule, a person's first
name tends to be short (and you are only prompting for _a_ name),
whereas the last name can be fairly long. This should be reflected in
the field widths, helping to user notice which one is for the last name.

On the other hand, if this is for a shipping address, you should
probably prompt for a single name, to contain the person's name as used
in postal addressing. Not all people have last names, and not all
peoples write the last name last, and not all people are unique by the
first name and the last name. It's _easier_ to have just one field for
the name if you are just going to put the name on an envelope, or
something like that. In that case, it should be a fairly long field, of
course.
Is there any way to do what I'm asking without tables?
Using or not using tables is rather irrelevant. What matters is what you
do, not how you do it.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Feb 15 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: C. Alexander | last post by:
I'm making a 'whiteboard' application. I'm trying to have 2+ connected users able to draw at the same time. However, if User1 draws a line, when User2 is drawing, on User1 screen, it will draw...
3
by: luke | last post by:
http://soccer.org/ notice how there's a background image at either side of the main content area. This background area keeps it's position without creating horizontal scrollbars and just...
10
by: Dan V. | last post by:
Is it possible to have 2 divs beside each other and one not wrap around? I realize the 2 div's are floating left but I can only think of this as the best solution for now. I am trying to get...
0
by: dag | last post by:
Hi! I would like to do an overlap window, over my main window (of my application), with a Progress Bar. Exactly when I push a button of my application I want show a window, with a Progress bar,...
3
by: cat | last post by:
Hi folks, We are going to update our db2 udb ee from v7.2 to v8.1 ( on aix 5.1 with fixpack 7). The problem is since our server consociation, we have 2 application running on the same server...
3
by: RC | last post by:
The Subject says its all. I would like do this by JavaScript. Normally vertical scroll bar is at right side of a box and horizontal scroll bar is at bottom of a box. I would like change...
7
by: eyal.herlin | last post by:
hi, i have the following demo code: <html> <head> </head> <frameset cols="30%,*"> <frame src=""> </frame> <frame src=""> </frame>
2
by: laredotornado | last post by:
Hi, I have a link and an image and I would like to keep them on the same horizontal plane. Right now, the image (named "close") is dropping below the text (that reading "New Tab"), despite the...
3
by: ilya2 | last post by:
I am making an HTML table. It has a lot of columns with fixed width (55 pixels). If I view it on full-screen IE window, the table fits on the screen and looks just as I want it to look. When I make...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.