课程: Design the Web: Creating a Sortable Table
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Highlighting the sorted column
- [Voiceover] Now we're going to work on some user feedback. We want to highlight the table header cell that represents the column that the data is being sorted against. Now when we assign the table sorter function to our table, what the plugin does is goes through the table header elements and it finds every one of the th element and adds header class and either a headerSortDown or headerSortUp class, depending on the direction of the sort. Now while the header class will always be injected, we can customize the additional classes that are added. So back in our JavaScript file, we're going to add two additional options into the table sorter function. So after the sortList option, let's add a comma, next line, we're going to add another option called css ascending, so that's css, and then a capital Asc, add in our colon and then a space. Now we're going to add in two tick marks for a string. Now, since classes are just strings in HTML, what we can do here is add a space and actually…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
Preparing the HTML file3 分钟 13 秒
-
(已锁定)
Activating the plugin6 分钟 2 秒
-
(已锁定)
Setting a default sort on page load3 分钟 24 秒
-
(已锁定)
Highlighting the sorted column4 分钟 54 秒
-
(已锁定)
Creating CSS triangles to indicate sort order4 分钟 34 秒
-
(已锁定)
Creating custom sort properties8 分钟 16 秒
-
(已锁定)
Where to go from here55 秒
-