Deepa Posted February 10, 2007 Share Posted February 10, 2007 Hi..I understnad that Code:<ol><li> Car</li><li>Bus</li><li>Train</li></ol>will display 1.Car2.Bus3.TrainI want the lists to appear decending order as in3.Car2.Bus1.TrainThe logic is "Train"-- was added first, and the most recent addition-- "Car" is shown at the topNow these lists are added dynamicaly .. so i cannot use the <li value=#></li> manually for all the list itemsAny help is great helpThank youDeepa Link to comment Share on other sites More sharing options...
ScottR Posted February 14, 2007 Share Posted February 14, 2007 If the page is dynamic and you are using a database. I would suggest ordering them by decending order when you access the database. Link to comment Share on other sites More sharing options...
jlhaslip Posted February 14, 2007 Share Posted February 14, 2007 Even if they are pulled from an array, you need to sort the array some how and massage the sort order and the count of elements in the array. It doesn't need to be a DB thing.The first item would be value = $count, the next is value = $count minus 1, etc. And most likely, use an un-ordered list and include the value a an echo'd part of the <li>. (or <tr><td>) Link to comment Share on other sites More sharing options...
Deepa Posted February 14, 2007 Author Share Posted February 14, 2007 Actullay I am tryoing to use this in my blog tempalteBy default.. the blog posts are not numbered,,, i was able to locate and add numbers to the posts..Since the posts are displayed in Latest post first.... i want the numbers to appear in decending order.. Link to comment Share on other sites More sharing options...
jlhaslip Posted February 14, 2007 Share Posted February 14, 2007 Then you would need to read the list of blog entries into and array, for example, and manage the mathematics using php, or ASP?That could work. Link to comment Share on other sites More sharing options...
Deepa Posted February 14, 2007 Author Share Posted February 14, 2007 hmm.. i think so too..How much i wish the <ol> tag had something lilke<ol order='ASC or DSC'> for ascending and descending order.. Would maek lot of things easierThanks anyway.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now