Join Leigh Lawhon for an in-depth discussion in this video Adding icons, part of Web Portfolio Projects: Sortable Table and Arrays.
- [Instructor] We'll start by adding a const iELe…and that's going to be equal to document.createElement…and we'll pass in i.…We'll give that a className…that's equal to fas…because I'm using Font Awesome and mainIcon.…We want to check to see…if the key is equal to Population growth rate.…
And if so,…we'll check to see if the value…is greater than zero.…And if so, we're going to change the className…to equal fas…and we'll do fa-arrow-up.…And if the value is less than zero…and therefore a negative number,…we'll do iEle.className…and that's going to be equal to fas and fa-arrow-down.…
Finally, let's take the tdElement and appendChild…and pass in our i element.…We'll take a look at that in our browser…and you'll see I now have up arrows for positive numbers…and down arrows for negative numbers.…We'll drag in area…and you'll also notice that I have icons…for both area and population.…I do that a little bit differently than I did the arrows.…Let's inspect…and you'll see that the i element has a before…with a content that has unicode in it.…
- Sorting your table efficiently
- Filtering null values and sorting nodes
- Sorting algorithms, including merge sort and insertion sort
- Performance testing
- Creating your own algorithm
- Design components
- Adding icons
Skill Level Intermediate
Workflow Tools for Web Developerswith Christina Truong1h 13m Intermediate
What you should know1m 33s
1. Getting Started
2. Sorting Our Table Efficiently
3. Sorting Algorithms
4. Creating Our Own Algorithm
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.