Change repeater li item class if first or last

前端 未结 10 2149
时光说笑
时光说笑 2020-12-05 07:11

I\'m using repeater to create dynamic ul li list

Is it possible to control class whether item is first or last?

Something like:

class=\"<%         


        
10条回答
  •  暖寄归人
    2020-12-05 07:19

    If possible, I'd recommend using something like jQuery for this as it makes implementing this type of functionality very easy. For example, you could have something like this:

    
        
    My Data
    $("table.MyRepeater tr:last").attr("class", "last");

提交回复
热议问题