Hello All, I have some list in HTML format: <ul> <li>Item1</li> <li>Item2</li> <li>Item3</li> <li>Item4</li> <li>Item5</li> </ul> It looks now so: Item1 Item2 Item3 Item4 Item5 It forms automatically from ASP.NET. I wuld like automatically divide it into 2 parts so that it should looks like this: Item1 Item2 Item3 Item4 Item5 Also it must be bulleted. How to do it? Thank you. Serge.
Set a class, say .special, on the first item and every other item thereafter. Style the item like so: .special { float: left; clear: left; width: 50%; } Code (markup): With the html like this: <ul> <li class="special">Item1</li> <li>Item2</li> <li class="special">Item3</li> <li>Item4</li> <li class="special">Item5</li> </ul> Code (markup): Set ul {overflow:hidden;} to enclose the last unpaired float, if any. cheers, gary
That's what the script does for you. When you fill your array from whatever source for the list, as you step through creating the list, add the class token to every other list element. Loosely, using php syntax, 'cuz that's what I know: // $listitems is the filled array for ($i = 0; $i < $listitems.length; $i++) { if ($i % 2 == 0) { echo "<li class="special">$listitems[$i]</li>"; } else { echo "<li>$listitems[$i]</li>"; } Code (markup): cheers, gary