What is the best way to style alternating rows in a table?

后端 未结 12 547
南方客
南方客 2020-12-11 11:09

Obviously, the actual style of the odd/even rows will be done via a CSS class, but what is the best way to \"attach\" the class to the rows? Is is better to put it in the ma

12条回答
  •  青春惊慌失措
    2020-12-11 11:52

    I would do this initially server-side since the client may not have javascript enabled. If you are adding/removing rows client-side with javascript, then you may want to also have the ability to do it on the client after the add/remove event has completed. As much as possible you should try to have your interface behave well without Javascript unless you can control the browser environment (say, for example, in an intranet app where you can require that it be enabled).

提交回复
热议问题