473,382 Members | 1,733 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,382 software developers and data experts.

Problem in styling List

Ray
Hi Groups

To achieve the visual effect of the page
http://www.freewebs.com/nsl/test1.html
but remove the table and use CSS, I wrote a page like this
http://www.freewebs.com/nsl/test2.html
I define items in the <dl> element inline, and use DIV to break a
dt-dd group to a block. I also use DIV to split the <ul> element into
to 3 columns.
But this page fails the XHTML validation. XHTML does not allow me to
add DIV between list item.
I changed the code and tried the W3C validator's test. It finally pass
the validation:
http://www.freewebs.com/nsl/test3.html
But I don't like the <br /> in the <dl>. they just serve the
presentation purpose and are not necessary in the HTML document. I
don't think the <div class="member"> element is in good structure:
those guys are in one group not three ones. The <div
class="member_float"> element is even worse: I want to keep the same
order (sorted by last name) both in the HTML source code and the page
presentation with or without CSS.
What is the "elegant" design for this situation?
Thanks
Jul 20 '05 #1
5 2208
lo****@mail.com (Ray) wrote:
Hi Groups
Pointless crossposting removed. At least you should have set follow ups
to one group.
What is the "elegant" design for this situation?


Scrap the current "design", it is inflexible and illogical.

You have 3 choices for that list: block, inline or floated with a fixed
width, the latter comes closest to what you have now (but without the
inflexibility).

--
Spartanicus
Jul 20 '05 #2
Ray wrote:
Hi Groups
Please choose 1 group to post to. Or at least suggest followups. It
saves us time. I'll leave it to you to choose a f'up group if you have
further questions.
To achieve the visual effect of the page
http://www.freewebs.com/nsl/test1.html
but remove the table and use CSS,
But the top looks like a table to me.

<TABLE>
<TR>
<TD>Jayaram Bhasker</TD>
<TD>Chair</TD>
</TR>
<TR>
<TD>Rob Anderson</TD>
<TD>Compiler Directives</TD>
</TR>
<!-- etc. -->
</TABLE>

If it helps, consider that you could have table headers:

<TR>
<TH>name</TH>
<TH>position</TH>
</TR>

That, to me, indicates that you have real tabular data, and that table
markup is appropriate. You can use css to center the table, make the
second td in each row italics, etc. Right align the first td, left align
the second, and you're pretty close to what I think you want.
I define items in the <dl> element inline, and use DIV to break a
dt-dd group to a block.
You suggest an inline presentation, then add more markup to get
block-level like behavior. If you don't want to use table markup, then
simplify what you've chosen instead. Leave dt and dd as block level, and
float the dt left.
I also use DIV to split the <ul> element into to 3 columns.
Having content flow from one column to the next is not trivial. The
easiest way is to create 3 UL elements, and float the first 2 left.
But this page fails the XHTML validation.


Is there a reason for choosing XHTML instead of the more robust HTML?

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #3
Ray wrote:
Hi Groups
Please choose 1 group to post to. Or at least suggest followups. It
saves us time. I'll leave it to you to choose a f'up group if you have
further questions.
To achieve the visual effect of the page
http://www.freewebs.com/nsl/test1.html
but remove the table and use CSS,
But the top looks like a table to me.

<TABLE>
<TR>
<TD>Jayaram Bhasker</TD>
<TD>Chair</TD>
</TR>
<TR>
<TD>Rob Anderson</TD>
<TD>Compiler Directives</TD>
</TR>
<!-- etc. -->
</TABLE>

If it helps, consider that you could have table headers:

<TR>
<TH>name</TH>
<TH>position</TH>
</TR>

That, to me, indicates that you have real tabular data, and that table
markup is appropriate. You can use css to center the table, make the
second td in each row italics, etc. Right align the first td, left align
the second, and you're pretty close to what I think you want.
I define items in the <dl> element inline, and use DIV to break a
dt-dd group to a block.
You suggest an inline presentation, then add more markup to get
block-level like behavior. If you don't want to use table markup, then
simplify what you've chosen instead. Leave dt and dd as block level, and
float the dt left.
I also use DIV to split the <ul> element into to 3 columns.
Having content flow from one column to the next is not trivial. The
easiest way is to create 3 UL elements, and float the first 2 left.
But this page fails the XHTML validation.


Is there a reason for choosing XHTML instead of the more robust HTML?

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #4
Ray scribbled something along the lines of:
Hi Groups

To achieve the visual effect of the page
http://www.freewebs.com/nsl/test1.html
but remove the table and use CSS, I wrote a page like this
http://www.freewebs.com/nsl/test2.html
I define items in the <dl> element inline, and use DIV to break a
dt-dd group to a block. I also use DIV to split the <ul> element into
to 3 columns.
But this page fails the XHTML validation. XHTML does not allow me to
add DIV between list item.
I changed the code and tried the W3C validator's test. It finally pass
the validation:
http://www.freewebs.com/nsl/test3.html
But I don't like the <br /> in the <dl>. they just serve the
presentation purpose and are not necessary in the HTML document. I
don't think the <div class="member"> element is in good structure:
those guys are in one group not three ones. The <div
class="member_float"> element is even worse: I want to keep the same
order (sorted by last name) both in the HTML source code and the page
presentation with or without CSS.
What is the "elegant" design for this situation?
Thanks


Learn CSS.

This is really a common problem yet easy to solve.
All you need to do is use the clear property to stop elements from
lining up any more than you want them to.

However a design like

Jayaram Bhasker: Chair
Rob Anderson: Compiler Directives
David Bishop: Web and Reflextor Administrator
Apurva Kalia: Semantics Task Leader
[..]

or more correctly

Chair: Jayaram Bhasker
Compiler Directives: Rob Anderson
Web and Reflector David Bishop
Administrator:
Semantics Task Apurva Kalia
Leader:

would be easier than your centered version.
Just set dt up as "clear: left" so they don't float ridiculously.

The second part looks like a three-column list. The only way to do this
with a list that I can think of is to have three lists like so:

<ul id="container">
<li><ul id="column1">
<li>Victor Berman</li>
[..]
</ul></li>
<li><ul id="column2">
<li>Robert A. Flatt</li>
[..]
</ul></li>
<li><ul id="column3">
<li>Doug Perry</li>
[..]
</ul></li>
</ul>

and having the columns positioned. There may be other ways to solve this
with a list, but I do not think you can do this solely with CSS until
CSS 3 is widely support (there is column functionality in CSS 3 which
allows breaking one box into multiple columns).

I would rethink what you are trying to archieve. Are you interested in
making it look good, readable and accessible or are you trying to
archieve a pixel perfect transition from tabular to pure CSS layout? In
the later case I would recommend using something other than HTML/CSS.
Maybe a PDF would be preferable there.

--
Alan Plum, WAD/WD, Mushroom Cloud Productions
http://www.mushroom-cloud.com/
Jul 20 '05 #5
Ray scribbled something along the lines of:
Hi Groups

To achieve the visual effect of the page
http://www.freewebs.com/nsl/test1.html
but remove the table and use CSS, I wrote a page like this
http://www.freewebs.com/nsl/test2.html
I define items in the <dl> element inline, and use DIV to break a
dt-dd group to a block. I also use DIV to split the <ul> element into
to 3 columns.
But this page fails the XHTML validation. XHTML does not allow me to
add DIV between list item.
I changed the code and tried the W3C validator's test. It finally pass
the validation:
http://www.freewebs.com/nsl/test3.html
But I don't like the <br /> in the <dl>. they just serve the
presentation purpose and are not necessary in the HTML document. I
don't think the <div class="member"> element is in good structure:
those guys are in one group not three ones. The <div
class="member_float"> element is even worse: I want to keep the same
order (sorted by last name) both in the HTML source code and the page
presentation with or without CSS.
What is the "elegant" design for this situation?
Thanks


Learn CSS.

This is really a common problem yet easy to solve.
All you need to do is use the clear property to stop elements from
lining up any more than you want them to.

However a design like

Jayaram Bhasker: Chair
Rob Anderson: Compiler Directives
David Bishop: Web and Reflextor Administrator
Apurva Kalia: Semantics Task Leader
[..]

or more correctly

Chair: Jayaram Bhasker
Compiler Directives: Rob Anderson
Web and Reflector David Bishop
Administrator:
Semantics Task Apurva Kalia
Leader:

would be easier than your centered version.
Just set dt up as "clear: left" so they don't float ridiculously.

The second part looks like a three-column list. The only way to do this
with a list that I can think of is to have three lists like so:

<ul id="container">
<li><ul id="column1">
<li>Victor Berman</li>
[..]
</ul></li>
<li><ul id="column2">
<li>Robert A. Flatt</li>
[..]
</ul></li>
<li><ul id="column3">
<li>Doug Perry</li>
[..]
</ul></li>
</ul>

and having the columns positioned. There may be other ways to solve this
with a list, but I do not think you can do this solely with CSS until
CSS 3 is widely support (there is column functionality in CSS 3 which
allows breaking one box into multiple columns).

I would rethink what you are trying to archieve. Are you interested in
making it look good, readable and accessible or are you trying to
archieve a pixel perfect transition from tabular to pure CSS layout? In
the later case I would recommend using something other than HTML/CSS.
Maybe a PDF would be preferable there.

--
Alan Plum, WAD/WD, Mushroom Cloud Productions
http://www.mushroom-cloud.com/
Jul 20 '05 #6

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

Similar topics

3
by: Ray | last post by:
Hi Groups To achieve the visual effect of the page http://www.freewebs.com/nsl/test1.html but remove the table and use CSS, I wrote a page like this http://www.freewebs.com/nsl/test2.html I...
29
by: Joseph Haig | last post by:
I am trying to use descriptive lists, <DL>, as shown in <http://www.maths.man.ac.uk/~jhaig/tmp/test.html> with a style sheet at <http://www.maths.man.ac.uk/~jhaig/tmp/default-2.css>. With Mozilla...
5
by: Peter Collinson | last post by:
Hi... Is there any way to style a List Item a different color and size than the <LI> in an Ordered List? I'd like a red super-script number and a dark blue text in a page's footnotes. And...
11
by: skeeterbug | last post by:
not sure what i'm doing developing on xmas... but i guess we all have our own demons! -lol- i'm using the following css to style my horizontal menu... /* STYLE HORIZONTAL MENU */ #hmenu...
7
by: David Shorthouse | last post by:
I am attempting to create a "new account creation" asp, but would ideally like the routine to check the Access db for an existing email address and username (called UID below). The select query...
10
by: matt_randle | last post by:
Hi, I have a problem styling a definition list. If you look at http://68.178.211.60/MattRandle/Guides/Plants/MarginalsNZ.htm you will see the effect I am trying to achieve. If, however,...
6
by: ashkaan57 | last post by:
Hi, How can I set up the styling for different levels of <ULto use different images for bullets, be indenetd differently, ... Like: .. list 1 - item 1 - item 2 .. list 2
1
by: TomT | last post by:
I am having a difficult time solving a problem. Whenever I use :hover in a certain <div> the page shrinks in IE6. Of course, this problem does not exist with other browsers. It is even more vexing...
12
by: Lars Eighner | last post by:
I take this example from a writer in alt.usage.english <news://r3jie3p93s1eaflgcckn2hinf3li4mnfud@4ax.com>, where the question of whether the "and" is required came up strictly as an issue of...
2
by: shapper | last post by:
Hello, I am styling the labels on a section of my page as follows: label {float: left; width: 6.5em;} Now I want to remove this styling from a label that has the class "Message". Mu...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...

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.