HighDots Forums  

How do I line up checkboxes vertically beside an indented list?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss How do I line up checkboxes vertically beside an indented list? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brian Kendig
 
Posts: n/a

Default How do I line up checkboxes vertically beside an indented list? - 08-16-2007 , 04:47 PM






I want to have a set of nested UL elements where every LI has a
checkbox associated with it, and the checkboxes are all lined up
vertically either to the left or the right of the list. In other
words, something like this (my apologies if you're not using a fixed-
width font):

x - Item 1
x - Item 1a
x - Item 1b
x - Item 2
x - Item 2a
x - Item 2a1

or,

- Item 1 x
- Item 1a x
- Item 1b x
- Item 2 x
- Item 2a x
- Item 2a1 x

I want each checkbox to be associated with its list element - in other
words, I don't want to have the list items all in one div, and the
checkboxes to be all in a separate div beside it, because then they
might not line up properly - the list wouldn't be as tall as the
checkboxes.

How could I go about doing this?


Reply With Quote
  #2  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: How do I line up checkboxes vertically beside an indented list? - 08-17-2007 , 01:25 AM






Scripsit Brian Kendig:

Quote:
I want to have a set of nested UL elements where every LI has a
checkbox associated with it, and the checkboxes are all lined up
vertically either to the left or the right of the list.
This might be a wrong approach, whatever the original problem was. I'd
suggest that you start with describing the original problem or goal and
illustrate your current approach with a URL. Basically, CSS is just about
optional styling, so before you even start considering CSS issues with a
page, you should have a page written, with valid and logical markup, so that
you naturally post the URL with your question.

Quote:
In other
words, something like this (my apologies if you're not using a fixed-width
font):
No apology granted for the omission of a URL.

Quote:
x - Item 1
x - Item 1a
x - Item 1b
x - Item 2
x - Item 2a
x - Item 2a1
That'll probably be confusing, with _both_ list bullets _and_ checkboxes. It
would (_if_ the approach as such is feasible) probably be better to suppress
the list bullets and let the checkboxes play their role too, in addition to
being input elements.

Quote:
I want each checkbox to be associated with its list element - in other
words, I don't want to have the list items all in one div, and the
checkboxes to be all in a separate div beside it, because then they
might not line up properly - the list wouldn't be as tall as the
checkboxes.
Sorry, but that's too vague a description, and it's very difficult to see
what you have tried. The natural markup would have just ul, li, label, and
input elements and no div.

Vertical placement of checkboxes can be tricky, but is this about it, or
something else?

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



Reply With Quote
  #3  
Old   
Brian Kendig
 
Posts: n/a

Default Re: How do I line up checkboxes vertically beside an indented list? - 08-17-2007 , 09:11 AM



Quote:
I'd suggest that you start with describing the original problem or goal and
illustrate your current approach with a URL.
The original problem is that I have a hierarchy of items which need to
be able to be selected or deselected with checkboxes, and I want the
checkboxes lined up vertically for neatness.

Here is a URL to show what I'm trying to accomplish.

http://www.enchanter.net/listfoo.png




Reply With Quote
  #4  
Old   
Jon Fairbairn
 
Posts: n/a

Default Re: How do I line up checkboxes vertically beside an indented list? - 08-17-2007 , 10:03 AM



Brian Kendig <brian (AT) enchanter (DOT) net> writes:

Quote:
I'd suggest that you start with describing the original problem or goal and
illustrate your current approach with a URL.

The original problem is that I have a hierarchy of items which need to
be able to be selected or deselected with checkboxes, and I want the
checkboxes lined up vertically for neatness.
Do you really want that? Lined up on the right, if one of
the items is long, it can be hard to see which checkbox
corresponds to the other items. If on the left and the
depth of nesting of ULs is large, the same thing applies.

Quote:
Here is a URL to show what I'm trying to accomplish.

http://www.enchanter.net/listfoo.png
You offer payment with pictures of £5 notes, too, I suppose?

--
Jón Fairbairn Jon.Fairbairn (AT) cl (DOT) cam.ac.uk



Reply With Quote
  #5  
Old   
Brian Kendig
 
Posts: n/a

Default Re: How do I line up checkboxes vertically beside an indented list? - 08-17-2007 , 10:44 AM



On Aug 17, 10:03 am, Jon Fairbairn <jon.fairba... (AT) cl (DOT) cam.ac.uk> wrote:

Quote:
Do you really want that? Lined up on the right, if one of
the items is long, it can be hard to see which checkbox
corresponds to the other items. If on the left and the
depth of nesting of ULs is large, the same thing applies.
I'll set the background of every other row to a different color to
avoid this.

I actually need to display four checkboxes for each row, so that the
user can see at a glance which areas of the application he has create,
read, update, and delete access on. You can see how putting four
checkboxes on each row, not lined up vertically, would be visual
chaos. But for the purposes of this example, one checkbox suffices.

Quote:
You offer payment with pictures of £5 notes, too, I suppose?
If I knew how to do it in HTML and CSS, mate, then I wouldn't have
come here asking how to do it in HTML and CSS.




Reply With Quote
  #6  
Old   
Brian Kendig
 
Posts: n/a

Default Re: How do I line up checkboxes vertically beside an indented list? - 08-17-2007 , 11:57 AM



If you'd like to suggest a better approach, by the way, you're very
welcome.

The situation is that I have the entire web application represented by
a tree. An admin needs to be able to see and modify, for a given role,
exactly what areas of the application that user can use to create,
update, modify, or delete data.

I think the most straightforward approach is to display the
hierarchical site tree as nested UL elements and have four columns of
checkboxes lined up beside it. If you can think of something better,
I'm all ears.



Reply With Quote
  #7  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: How do I line up checkboxes vertically beside an indented list? - 08-17-2007 , 12:28 PM



Brian Kendig wrote:
Quote:
If you'd like to suggest a better approach, by the way, you're very
welcome.

You who? Please quote in Usenet.

Quote:
The situation is that I have the entire web application represented by
a tree. An admin needs to be able to see and modify, for a given role,
exactly what areas of the application that user can use to create,
update, modify, or delete data.
Okay.

Quote:
I think the most straightforward approach is to display the
hierarchical site tree as nested UL elements and have four columns of
checkboxes lined up beside it. If you can think of something better,
I'm all ears.

Okay, but I did show one possible example in this thread

http://message-id.net/<c7e25$46c5a548$40cba7a7$9157 (AT) NAXS (DOT) COM>

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com


Reply With Quote
  #8  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: How do I line up checkboxes vertically beside an indented list? - 08-17-2007 , 02:01 PM



Scripsit Brian Kendig:

Quote:
If I knew how to do it in HTML and CSS, mate, then I wouldn't have
come here asking how to do it in HTML and CSS.
If you don't know how to do "it" in HTML, learn that first, before trying to
style it with CSS. Here "it" means the logical structure and corresponding
markup, as far as possible, with some realistic (though perhaps not quite
real) content. Ask in c.i.w.a.html or c.i.w.a.site-design if you need help
with that part. Include sufficient content to give an idea of what you are
really doing. (The picture does not really paint a picture. It looks like
deeply nested list with one-item sublists. Odd.)

Write down 100 times: CSS is for optional presentational suggestions.

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



Reply With Quote
  #9  
Old   
Brian Kendig
 
Posts: n/a

Default Re: How do I line up checkboxes vertically beside an indented list? - 08-17-2007 , 02:08 PM



On Aug 17, 12:28 pm, "Jonathan N. Little" <lws4... (AT) centralva (DOT) net>
wrote:
Quote:
Brian Kendig wrote:
If you'd like to suggest a better approach, by the way, you're very
welcome.

You who? Please quote in Usenet.
You may want to see if your newsreader will let you view Usenet posts
as a tree, so that it's easy to see which post mine was in reply to.
If you're using Google Groups, then click on 'Options' by the thread
title near the top of the page, then 'View as tree'.

In this particular situation, however, 'you' can refer to anyone you'd
like it to; if there's anyone who feels like offering a better
solution, feel free.

Quote:
Okay, but I did show one possible example in this thread
http://message-id.net/<c7e25$46c5a548$40cba7a7$9... (AT) NAXS (DOT) COM
I'll have a look - thank you very much.




Reply With Quote
  #10  
Old   
Rik
 
Posts: n/a

Default Re: How do I line up checkboxes vertically beside an indented list? - 08-17-2007 , 02:21 PM



On Fri, 17 Aug 2007 20:08:56 +0200, Brian Kendig <brian (AT) enchanter (DOT) net>
wrote:

Quote:
On Aug 17, 12:28 pm, "Jonathan N. Little" <lws4... (AT) centralva (DOT) net
wrote:
Brian Kendig wrote:
If you'd like to suggest a better approach, by the way, you're very
welcome.

You who? Please quote in Usenet.

You may want to see if your newsreader will let you view Usenet posts
as a tree, so that it's easy to see which post mine was in reply to.
That post might not be there, learn more about usenet.
--
Rik Wasmus


Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.