Jump to content

List manipulation


damiancds

Recommended Posts

I've got two questions:1. how can i split up a list so that it acts justified? ex.(the list i have now)- list item 1- list item 2- list item 3- list item 4(what i hope to achieve)- list item 1 - list item 2- list item 3 - list item 42. Is there any way i can specifically change the value of an ol or li value?ex.2 1/2 cups brown sugarwhere 2 1/2 would be the list bullet and the "cups brown sugar" would be the rest of the list itemthe last question could probably be done without css but I'm not sure so i put it with my other question.Honestly, the second question is the most important right now, but i'd like to be able to do both.I'd appreciate what you can throw at me,thanks,EDIT:I got to thinking and my second question could be solved by using tables, but, is that acceptable? I mean, when people mention tables, everybody in the room seems to shout to use css instead, and is this one of those times or is this where a table would be the thing to use.thanks,

Link to comment
Share on other sites

I'd say for a list of ingredients a table would be acceptable, but could you not use two lists side by side? Most of the people who get shouted at for using tables are using tables for layout or positioning/alignment, definite no-no's.

Link to comment
Share on other sites

oh, i had no intention of using a table for the first problem.to give context, I'm trying to design a sort-of recipe card where I've got a title, then image, then stats. Below the stats are a side by side a list of ingredients (where the table would come in) and a list of preperation steps, then below those, a list of notes (like what goes with the dish and what not)the stats is the only place i'd use the list from my first question where it'd be like- cooking time: 1 hour - Prep time: 15 Min- Servings: - Oven Temp: 350 Fsomething like that, where each list item would be justified so it would retain some kind of order and not some jumbled mess.EDIT:but yes, now i don't have to worry about figuring out how to the the second questionthanks,

Link to comment
Share on other sites

the stats is the only place i'd use the list from my first question where it'd be like- cooking time: 1 hour - Prep time: 15 Min- Servings: - Oven Temp: 350 F
I think you could still use a table to do that. But if you wanted to use a list you'd create two classes for your <li> elements. One would float the elements, the other would clear.I think this is how it would work:
//CSS.float {   float: left;}.clear {   clear: right;}//HTML<ul><li class='float'>one</li><li class='clear'>two</li><li class='float'>three</li><li class='clear'>four</li></ul>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...