课程: Design the Web: Creating a Sortable Table
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Setting a default sort on page load
- [Voiceover] So now after writing one line of code, we have a sortable table using this plugin. So now what we're going to do is have the table automatically sort based on one of these individual table headings when the page loads. Now if we go back to our HTML file, we'll see that the HTML is in a specific order. Styling form elements here is at the top, with its date, and then CSS controlled SBG. So when the browser loads this page, this is the order that all the HTML gets loaded into the browser's RAM. So what we're gonna do back in the JavaScript file is change this when the page loads. So inside of the parenthesis for table sort order, we can add a couple of additional options. So the first thing we'll need to do is add a beginning and ending curly bracket inside of the parenthesis. This way we can add additional options inside of the table sorter function. And now let's split that open and inside here, let's add our first parameter, or our first property, which is called sort…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
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 秒
-