473,418 Members | 3,795 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,418 software developers and data experts.

How could I format a <ul> or <ol> tree into 2 columns using CSS?

A 2 columns x 10 rows matrix input form

<ul>
<li>
<ul>
<li>item name 1
<li><input type="textbox" name="input_col_1_row_1">
<li><input type="textbox" name="input_col_1_row_2">
</ul>
<li>
<ul>
<li>item name 2
<li><input type="textbox" name="...">
<li><input type="textbox" name="....">
</ul>
:
:
<li>
<ul>
<li>item name 20
<li><input type="textbox" name="input_col_2_row_9">
<li><input type="textbox" name="input_col_2_row_10">
</ul>
</ul>

Or should I just use plain <tablefor this kind programming stuffs?

--
iTech Consulting Services Limited
Expert of ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288
Apr 24 '07 #1
3 6662
Scripsit Man-wai Chang:
A 2 columns x 10 rows matrix input form
Why? What's the real page like? URL?

For usability and accessibility, we should normally follow the principle of
having one input item and its label, associated with <labelmarkup, on one
line.
<ul>
Why are you using a list if you think it's a matrix? A list is logically a
special case of a matrix (a one-column matrix), but you are referring to two
columns.
<ul>
<li>item name 1
<li><input type="textbox" name="input_col_1_row_1">
<li><input type="textbox" name="input_col_1_row_2">
</ul>
And why is _this_ a list? And it has three components, not two. There is no
label for either of the input items. If you think how you would use <label>
for them, you'll see one reason for following the above-mentioned principle.

Each input item should have a label of its own. Besides, you should use
valid markup (type="textbox" isn't valid), and you should set the size="..."
attribute in input fields, since that's the best way to suggest a suitable
visible width. (CSS has no unit corresponding to the average width of
characters.)
Or should I just use plain <tablefor this kind programming stuffs?
This has nothing to do with programming.

If the list markup is logical in a case like this, then table markup would
be even more logical, since it involves a columnwise association as well.

But you haven't revealed any specifics.

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

Apr 24 '07 #2
Scripsit Man-wai Chang:
I am just curious about the possibility of using CSS to layout an
input form which consist of repeating groups of labels+textbox
I'm not, because it's not something that should be done in situations where
there are several textboxes per label.

In CSS terms, the best approach to this wrong problem would be the use of
table-related values for the display property. That's not supported by IE.
Even if it were, it would be odd to resist the idea of using a table for
tabular data in markup and then use CSS to make the stuff look like a table.

For a more reasonable idea of having one label and one input element per
line in a tabular manner (in two columns, really), there are many possible
approaches. You could play with float: left or with positioning. But why? If
it's logically a matrix with texts in one column and associated input fields
in another column, why wouldn't you make it a table in markup?
(attached a picture).
You thereby prevented many people from seeing your message at all, because
servers may filter out messages containing binary data (at least in
non-binary groups).

Never post an image in a comp.* group. Post a URL instead. If needed, first
upload the material onto a web server. (You should be able to do that,
especially since you ask in a www related group.)
I wonder whether it will be easier do it in CSS
Easier than what?
so that the PHP codes would not mingle with the layout stuffs.
You didn't mention anything about PHP previously, and I don't see how it
relates.

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

Apr 24 '07 #3
On Apr 24, 4:41 am, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit Man-wai Chang:
[...]
so that the PHP codes would not mingle with the layout stuffs.

You didn't mention anything about PHP previously, and I don't see how it
relates.
It relates if what you're asking is "would it be easier to produce
This layout, or That layout in PHP?".

I'd think it'd be easier for a PHP programmer to code a function that
outputs a table in HTML than
CSS. For that matter, why are you using PHP to generate *layout*?

May 4 '07 #4

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

Similar topics

13
by: Chris Goldie | last post by:
From an accessibility point of view, is there any advange in using <P> over <br>? eg, whats the difference between these two examples, are they both accessible? Eg. 1 <p>My first...
4
by: Timo Nentwig | last post by:
Hi! Is the following possible?         1. one   3. three         2. two   4. four And if so, how? If not, an offset attribute should be added to the next version of XHTML:
8
by: Michael | last post by:
This is a two-part question to which I haven't been able to find an answer anywhere else. 1. Is it possible to format the bullet/number character of the <li>? In my styles sheet, I have the <li>...
4
by: Peter | last post by:
Hi at all To make a list using <UL><IL> showed horizontally AND with ITEMS SPACED 30pixels. waht CSS command have I to use please? Thank in advance Peter
4
by: Mark | last post by:
Hopefully I 'm missing something silly, but I can't find an easy way to loop all list items in a simple <ol>. I was hoping a for loop as shown below would be enough, however clicking "alert all" in...
1
by: jasonchan | last post by:
How do you align <ol> and <ul> elements when they are contained in a floated box? Here is my website: http://geocities.com/jasonchan483/ Here's my problem. The markers of the lists are...
7
by: patrick j | last post by:
Hi I'm wondering about lists with nested lists as one does on a Saturday afternoon. Anyway below is an example of a list with a nested list which the iCab browser's very useful HTML...
5
nathj
by: nathj | last post by:
Hi All, I'm working on a new site that has a two column layout underneath a title bar. If you check out: http://www.christianleadership.org.uk/scratch/mainpage.php using IE or Opera you will...
2
by: Shahid | last post by:
Hi, I am parsing an .HTML file that contains following example code: <div> <p class="html_preformatted" awml:style="HTML Preformatted" dir="ltr" style="text-align:left"><span...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.