Sorting Mechanisms
About this Page
I sometimes want to sort content and I don't have a good method to do that currently. I also want a good way to filter content. When sorting, you usually want to sort by date or "trending" - something along those lines, and when filtering, you usually want to filter by whether or not a component has some kind of flair or attribute.
Filtering
In signal processing, a filter is a device or process that removes some unwanted components or features from a signal.
In terms of programming web applications, filtering means that you have some Elements inside a container Element, and you want the container element to only contain the Elements that meet some condition.
Sorting
Sorting refers to ordering data in an creasing or decreasing manner according to some linear relationship among the data items.
- ordering: arranging items in a sequence ordered by some criterion
- categorizing: grouping items with similar properties
Ordering items is the combination or categorizing them based on equivalent order, and ordering the categorizing themselves.
Table Sorting
A good example of table sorting can be found on the Wikipedia page List of countries and dependencies by population. I am going to try to create table sorting that lets you sort alphabetically or numerically. I created this just to see how it should work before implementing it in the Lexical Rich Text Editor.
Location | Population | % of World | Date | Source |
---|---|---|---|---|
![]() | 1,408,280,000 | 17.3% | Tue Dec 31 2024 | Official estimate |
![]() | 1,402,737,000 | 17.2% | Mon Jul 01 2024 | Official projection |
![]() | 340,110,988 | 4.2% | Mon Jul 01 2024 | Official estimate |
![]() | 282,477,584 | 3.5% | Sun Jun 30 2024 | National annual projection |
![]() | 241,499,431 | 3% | Wed Mar 01 2023 | 2023 census result |
![]() | 223,800,000 | 2.7% | Sat Jul 01 2023 | Official projection |
![]() | 212,583,750 | 2.6% | Mon Jul 01 2024 | Official projection |
![]() | 169,828,911 | 2.1% | Tue Jun 14 2022 | 2022 census result |
![]() | 146,150,789 | 1.8% | Mon Jan 01 2024 | Official estimate |
![]() | 130,154,247 | 1.6% | Mon Sep 30 2024 | National quarterly estimate |
![]() | 123,740,000 | 1.5% | Sun Dec 01 2024 | Monthly national estimate |
![]() | 114,163,719 | 1.4% | Mon Jul 01 2024 | Official projection |
![]() | 109,499,000 | 1.3% | Mon Jul 01 2024 | National annual projection |
![]() | 109,276,000 | 1.3% | Mon Jul 01 2024 | UN estimate |
![]() | 105,914,499 | 1.3% | Mon Jan 01 2024 | Official estimate |
![]() | 101,300,000 | 1.2% | Mon Jul 01 2024 | Official estimate |
![]() | 85,961,000 | 1.1% | Wed Mar 20 2024 | Official estimate |
![]() | 85,372,377 | 1% | Sun Dec 31 2023 | Official estimate |
![]() | 84,746,132 | 1% | Mon Sep 30 2024 | National quarterly estimate |
![]() | 68,567,000 | 0.8% | Sun Dec 01 2024 | Monthly national estimate |
![]() | 68,265,209 | 0.8% | Sat Jul 01 2023 | Official estimate |
![]() | 65,960,724 | 0.8% | Fri Nov 01 2024 | Monthly national estimate |
![]() | 63,015,904 | 0.8% | Tue Jul 30 2024 | Official estimate |
![]() | 61,741,120 | 0.8% | Tue Aug 23 2022 | 2022 census result |
![]() | 58,958,131 | 0.7% | Thu Oct 31 2024 | Monthly national estimate |
![]() | 52,695,952 | 0.6% | Mon Jan 01 2024 | Official projection |
![]() | 52,428,290 | 0.6% | Mon Jan 01 2024 | Official projection |
![]() | 51,316,756 | 0.6% | Tue Oct 15 2024 | 2024 census result |
![]() | 51,248,233 | 0.6% | Mon Sep 30 2024 | Monthly national estimate |
![]() | 50,448,963 | 0.6% | Mon Jul 01 2024 | UN projection |
![]() | 48,946,035 | 0.6% | Tue Oct 01 2024 | National quarterly estimate |
![]() | 47,400,000 | 0.6% | Wed Jan 01 2025 | National annual projection |
![]() | 47,067,641 | 0.6% | Mon Jul 01 2024 | National annual projection |
![]() | 45,935,046 | 0.6% | Fri May 10 2024 | 2024 census result |
![]() | 44,414,800 | 0.5% | Mon Jul 01 2024 | Official estimate |
![]() | 41,465,298 | 0.5% | Tue Oct 01 2024 | National quarterly estimate |
![]() | 37,543,167 | 0.5% | Wed Jan 01 2025 | National quarterly estimate |
![]() | 37,519,000 | 0.5% | Thu Oct 31 2024 | Monthly national estimate |
![]() | 36,828,330 | 0.5% | Sun Sep 01 2024 | 2024 census result |
![]() | 35,695,527 | 0.4% | Mon Jul 01 2024 | Official estimate |
![]() | 35,121,734 | 0.4% | Sat Jun 01 2024 | National annual projection |
![]() | 34,112,400 | 0.4% | Mon Sep 30 2024 | National quarterly estimate |
![]() | 34,038,457 | 0.4% | Mon Jul 01 2024 | National annual projection |
![]() | 33,443,000 | 0.4% | Mon Jan 01 2024 | IMF estimate |
![]() | 33,244,414 | 0.4% | Mon Jul 01 2024 | National annual projection |
![]() | 33,007,618 | 0.4% | Mon Jul 01 2024 | National annual projection |
![]() | 32,305,264 | 0.4% | Fri Jul 01 2022 | Official estimate |
![]() | 32,175,224 | 0.4% | Tue May 10 2022 | 2022 census result |
![]() | 30,811,969 | 0.4% | Mon Jul 01 2024 | National annual projection |
![]() | 29,389,150 | 0.4% | Tue Dec 14 2021 | 2021 census result |
![]() | 29,164,578 | 0.4% | Thu Nov 25 2021 | 2021 census result |
![]() | 28,758,503 | 0.4% | Mon Jul 01 2024 | National annual projection |
![]() | 28,405,543 | 0.3% | Mon Jul 01 2024 | UN projection |
![]() | 27,204,800 | 0.3% | Sun Jun 30 2024 | Official projection |
![]() | 26,312,034 | 0.3% | Mon Jul 01 2024 | National annual projection |
![]() | 25,950,000 | 0.3% | Thu Jul 01 2021 | National annual projection |
![]() | 24,672,760 | 0.3% | Mon Jul 01 2024 | UN projection |
![]() | 23,409,015 | 0.3% | Mon Jul 01 2024 | National projection |
![]() | 23,400,220 | 0.3% | Tue Dec 31 2024 | Official estimate |
![]() | 22,395,489 | 0.3% | Wed Jun 15 2022 | 2022 census result |
![]() | 21,916,000 | 0.3% | Mon Jul 01 2024 | Official estimate |
![]() | 20,270,568 | 0.2% | Mon Jul 01 2024 | National annual projection |
![]() | 20,265,320 | 0.2% | Sun Dec 01 2024 | Official estimate |
![]() | 20,086,377 | 0.2% | Sun Jun 30 2024 | National annual projection |
![]() | 19,610,769 | 0.2% | Wed Sep 14 2022 | 2022 census result |
![]() | 19,064,409 | 0.2% | Mon Jan 01 2024 | Official estimate |
![]() | 19,009,151 | 0.2% | Mon Jul 01 2024 | UN projection |
![]() | 18,675,547 | 0.2% | Mon Jul 01 2024 | National annual projection |
![]() | 18,126,390 | 0.2% | Mon May 15 2023 | 2023 census result |
![]() | 18,045,683 | 0.2% | Sat Nov 30 2024 | Official estimate |
![]() | 17,843,132 | 0.2% | Mon Jul 01 2024 | National annual projection |
![]() | 17,336,307 | 0.2% | Mon Jul 01 2024 | Official projection |
![]() | 16,938,986 | 0.2% | Sat Oct 01 2022 | 2022 census result |
![]() | 16,751,469 | 0.2% | Mon Jul 01 2024 | Official projection |
![]() | 15,254,268 | 0.2% | Sat Jul 01 2023 | National annual projection |
![]() | 13,798,561 | 0.2% | Mon Jul 01 2024 | National annual projection |
![]() | 13,261,638 | 0.2% | Fri Jul 01 2022 | National annual projection |
![]() | 12,910,087 | 0.2% | Mon Jul 01 2024 | National annual projection |
![]() | 12,837,740 | 0.2% | Fri Jul 01 2022 | National annual projection |
![]() | 12,394,537 | 0.2% | Mon Jul 01 2024 | National annual projection |
![]() | 11,887,412 | 0.1% | Mon Jan 01 2024 | National estimate |
![]() | 11,872,024 | 0.1% | Fri Nov 01 2024 | Official estimate |
![]() | 11,781,559 | 0.1% | Thu Jul 01 2021 | National estimate |
![]() | 11,516,000 | 0.1% | Sun Dec 31 2023 | National estimate |
![]() | 11,312,620 | 0.1% | Sat Mar 23 2024 | 2024 census result |
![]() | 11,089,511 | 0.1% | Sat Dec 31 2022 | Official estimate |
![]() | 10,897,237 | 0.1% | Mon Sep 30 2024 | Official estimate |
![]() | 10,771,504 | 0.1% | Thu Nov 10 2022 | 2022 census result |
![]() | 10,678,556 | 0.1% | Sun Dec 31 2023 | Official estimate |
![]() | 10,639,726 | 0.1% | Sun Dec 31 2023 | 2023 estimate |
![]() | 10,588,230 | 0.1% | Sat Nov 30 2024 | Monthly national estimate |
![]() | 10,400,720 | 0.1% | Mon Jan 01 2024 | Official estimate |
![]() | 10,277,100 | 0.1% | Mon Jan 01 2024 | Official estimate |
![]() | 10,214,441 | 0.1% | Tue Oct 01 2024 | Monthly national estimate |
![]() | 10,027,000 | 0.1% | Tue Dec 31 2024 | National monthly estimate |
![]() | 9,892,632 | 0.1% | Mon Jul 01 2024 | National annual projection |
![]() | 9,584,627 | 0.1% | Mon Jan 01 2024 | Official estimate |
![]() | 9,198,124 | 0.1% | Tue Oct 01 2024 | National quarterly estimate |
![]() | 9,155,978 | 0.1% | Mon Jan 01 2024 | Official estimate |
![]() | 9,027,859 | 0.1% | Mon Sep 30 2024 | National quarterly estimate |
![]() | 8,884,032 | 0.1% | Mon Jul 01 2024 | National annual projection |
![]() | 8,095,498 | 0.1% | Tue Nov 08 2022 | 2022 census result |
![]() | 7,546,000 | 0.09% | Sat Jul 01 2023 | National annual projection |
![]() | 7,531,800 | 0.09% | Sun Jun 30 2024 | National estimate |
![]() | 7,381,023 | 0.09% | Mon Jul 01 2024 | UN projection |
![]() | 7,161,900 | 0.09% | Mon Jan 01 2024 | Monthly national estimate |
![]() | 7,057,841 | 0.09% | Sat Dec 17 2022 | 2022 census result |
![]() | 6,803,886 | 0.08% | Fri Jun 30 2023 | Official estimate |
![]() | 6,605,168 | 0.08% | Mon Jan 01 2024 | Official estimate |
![]() | 6,470,307 | 0.08% | Mon Jul 01 2024 | National annual projection |
![]() | 6,445,481 | 0.08% | Sun Dec 31 2023 | Official annual estimate |
![]() | 6,351,000 | 0.08% | Sun Jun 30 2024 | National annual projection |
![]() | 6,142,180 | 0.08% | Wed May 17 2023 | 2023 census result |
![]() | 6,109,644 | 0.07% | Thu Nov 10 2022 | Preliminary census result |
![]() | 6,036,900 | 0.07% | Sun Jun 30 2024 | Official estimate |
![]() | 5,989,985 | 0.07% | Tue Oct 01 2024 | National quarterly estimate |
![]() | 5,636,521 | 0.07% | Sat Nov 30 2024 | Monthly national estimate |
![]() | 5,585,044 | 0.07% | Mon Sep 30 2024 | National quarterly estimate |
![]() | 5,490,000 | 0.07% | Thu Jul 01 2021 | Official estimate |
![]() | 5,483,450 | 0.07% | Sun Jan 01 2023 | National annual projection |
![]() | 5,421,272 | 0.07% | Mon Sep 30 2024 | National quarterly estimate |
![]() | 5,380,300 | 0.07% | Mon Apr 01 2024 | National estimate |
![]() | 5,348,600 | 0.07% | Mon Sep 30 2024 | National quarterly estimate |
![]() | 5,309,625 | 0.07% | Sun Jun 30 2024 | National annual projection |
![]() | 5,259,612 | 0.06% | Sat Nov 30 2024 | Monthly national estimate |
![]() | 5,248,621 | 0.06% | Thu Nov 10 2022 | 2022 census result |
![]() | 4,927,532 | 0.06% | Mon Dec 25 2023 | 2023 census result |
![]() | 4,913,271 | 0.06% | Mon Jan 01 2024 | Official estimate |
![]() | 4,064,780 | 0.05% | Sun Jan 08 2023 | 2023 census result |
![]() | 3,859,686 | 0.05% | Sat Jul 01 2023 | Official estimate |
![]() | 3,694,600 | 0.05% | Mon Jan 01 2024 | Official estimate |
![]() | 3,535,603 | 0.04% | Mon Jul 01 2024 | UN projection |
![]() | 3,504,741 | 0.04% | Sun Dec 31 2023 | National annual projection |
![]() | 3,444,263 | 0.04% | Mon Nov 27 2023 | 2023 National census |
![]() | 3,264,873 | 0.04% | Sat Jul 01 2023 | Official estimate |
![]() | 3,203,295 | 0.04% | Mon Jul 01 2024 | Annual projection |
![]() | 3,067,400 | 0.04% | Mon Jan 01 2024 | National quarterly estimate |
![]() | 3,022,401 | 0.04% | Sun Sep 24 2023 | 2023 National census |
![]() | 2,897,430 | 0.04% | Wed Jan 01 2025 | Monthly national estimate |
![]() | 2,857,822 | 0.04% | Sun Jun 30 2024 | Monthly national estimate |
![]() | 2,825,544 | 0.03% | Mon Jul 01 2019 | National projection |
![]() | 2,423,300 | 0.03% | Mon Jan 01 2024 | Official estimate |
![]() | 2,417,471 | 0.03% | Fri Jul 01 2022 | National projection |
![]() | 2,410,338 | 0.03% | Thu Jul 01 2021 | National annual projection |
![]() | 2,408,586 | 0.03% | Mon Jul 01 2024 | National annual projection |
![]() | 2,402,113 | 0.03% | Mon Sep 18 2023 | 2023 national census |
![]() | 2,306,000 | 0.03% | Sat Jul 01 2023 | Official projection |
![]() | 2,126,324 | 0.03% | Mon Jul 01 2024 | National quarterly estimate |
![]() | 1,854,900 | 0.02% | Fri Nov 01 2024 | Monthly national estimate |
![]() | 1,826,247 | 0.02% | Sun Dec 31 2023 | Official estimate |
![]() | 1,781,308 | 0.02% | Sat Jul 01 2023 | National annual projection |
![]() | 1,588,670 | 0.02% | Mon Jul 01 2024 | Official estimate |
![]() | 1,585,566 | 0.02% | Thu Apr 04 2024 | 2024 national census |
![]() | 1,558,160 | 0.02% | Fri Jul 01 2022 | Official estimate |
![]() | 1,374,687 | 0.02% | Mon Jan 01 2024 | Official estimate |
![]() | 1,373,024 | 0.02% | Mon Jul 01 2024 | National annual projection |
![]() | 1,368,333 | 0.02% | Sun Jun 30 2024 | Official estimate |
![]() | 1,259,509 | 0.02% | Mon Jul 01 2024 | National estimate |
![]() | 1,235,549 | 0.02% | Mon Jul 01 2024 | Official projection |
![]() | 1,066,809 | 0.01% | Mon May 20 2024 | 2024 census result |
![]() | 918,100 | 0.01% | Fri Oct 01 2021 | 2021 census result |
![]() | 900,869 | 0.01% | Wed Jan 01 2025 | National annual projection |
![]() | 900,141 | 0.01% | Sun Dec 31 2023 | 2024 CIA Factbook est. |
![]() | 777,224 | 0.01% | Sun Dec 31 2023 | National annual projection |
![]() | 772,975 | 0.009% | Thu Jul 01 2021 | Official estimate |
![]() | 750,325 | 0.009% | Mon Jul 01 2024 | National annual projection |
![]() | 686,600 | 0.008% | Mon Sep 30 2024 | National quarterly estimate |
![]() | 672,050 | 0.008% | Mon Jan 01 2024 | Official estimate |
![]() | 623,633 | 0.008% | Tue Oct 31 2023 | 2023 census result |
![]() | 616,500 | 0.008% | Thu Jul 01 2021 | Official estimate |
![]() | 590,506 | 0.007% | Mon Jul 01 2024 | UN projection |
![]() | 542,051 | 0.007% | Sat Dec 31 2022 | Official estimate |
![]() | 515,132 | 0.006% | Tue Sep 13 2022 | 2022 census result |
![]() | 491,233 | 0.006% | Wed Jun 16 2021 | 2021 census result |
![]() | 476,214 | 0.006% | Sun Dec 31 2023 | Official projection |
![]() | 450,500 | 0.006% | Sat Jul 01 2023 | Official estimate |
![]() | 410,919 | 0.005% | Mon Jul 01 2024 | Official estimate |
![]() | 398,165 | 0.005% | Mon Apr 04 2022 | 2022 census result |
![]() | 388,790 | 0.005% | Tue Oct 01 2024 | National quarterly estimate |
![]() | 360,938 | 0.004% | Sat Dec 31 2022 | Official estimate |
![]() | 321,409 | 0.004% | Mon Jul 01 2024 | National annual projection |
![]() | 279,890 | 0.003% | Thu Jul 01 2021 | National annual projection |
![]() | 268,510 | 0.003% | Sun Jan 01 2023 | National annual projection |
![]() | 267,800 | 0.003% | Sat Dec 31 2022 | |
![]() | 244,236 | 0.003% | Sat Jan 01 2022 | Official estimate |
![]() | 228,319 | 0.003% | Mon Jul 01 2024 | National annual projection |
![]() | 205,557 | 0.003% | Sat Nov 06 2021 | Census 2021 |
![]() | 184,100 | 0.002% | Sat Jul 01 2023 | Official estimate |
![]() | 155,826 | 0.002% | Sat Sep 02 2023 | 2023 census result |
![]() | 153,836 | 0.002% | Wed Apr 01 2020 | 2020 census result |
![]() | 121,355 | 0.001% | Sun Jun 30 2024 | Official estimate |
![]() | 120,740 | 0.001% | Thu Jul 01 2021 | National annual projection |
![]() | 112,579 | 0.001% | Mon Jul 01 2019 | Official estimate |
![]() | 110,872 | 0.001% | Fri Jul 01 2022 | Official estimate |
![]() | 107,566 | 0.001% | Sun Dec 31 2023 | Official estimate |
![]() | 105,754 | 0.001% | Thu Jul 01 2021 | National annual projection |
![]() | 103,603 | 0.001% | Mon Jan 01 2024 | National annual estimate |
![]() | 103,267 | 0.001% | Sun Mar 21 2021 | 2021 census result |
![]() | 100,179 | 0.001% | Sat Jan 01 2022 | National annual estimate |
![]() | 87,146 | 0.001% | Wed Apr 01 2020 | 2020 census result |
![]() | 86,931 | 0.001% | Sat Nov 30 2024 | Official estimate |
![]() | 84,738 | 0.001% | Sun Dec 31 2023 | National annual projection |
![]() | 84,530 | 0.001% | Sat Apr 01 2023 | Official estimate |
![]() | 67,408 | 0.0008% | Sun Dec 31 2017 | Official estimate |
![]() | 64,781 | 0.0008% | Sun Dec 31 2023 | National quarterly estimate |
![]() | 64,055 | 0.0008% | Thu Jul 01 2021 | National annual projection |
![]() | 56,865 | 0.0007% | Sat Jul 01 2023 | National quarterly estimate |
![]() | 56,520 | 0.0007% | Fri Dec 31 2021 | Official estimate |
![]() | 54,675 | 0.0007% | Sun Dec 01 2024 | Monthly national estimate |
![]() | 51,320 | 0.0006% | Fri Dec 31 2021 | 2022 census result |
![]() | 49,710 | 0.0006% | Wed Apr 01 2020 | 2020 census result |
![]() | 49,309 | 0.0006% | Sat Jul 01 2023 | Official estimate |
![]() | 47,329 | 0.0006% | Wed Apr 01 2020 | 2020 census result |
![]() | 42,418 | 0.0005% | Thu Sep 30 2021 | 2021 Census |
![]() | 41,349 | 0.0005% | Mon Jan 01 2024 | Official estimate |
![]() | 40,232 | 0.0005% | Sun Jun 30 2024 | National estimate |
![]() | 38,367 | 0.0005% | Sun Dec 31 2023 | Census |
![]() | 38,000 | 0.0005% | Mon Nov 14 2022 | Preliminary census results |
![]() | 33,987 | 0.0004% | Thu Oct 31 2024 | Monthly national estimate |
![]() | 32,358 | 0.0004% | Wed Jan 01 2020 | Official estimate |
![]() | 31,538 | 0.0004% | Sat Jul 01 2023 | UN projection |
![]() | 16,733 | 0.0002% | Thu Jul 01 2021 | 2021 Census |
![]() | 15,931 | 0.0002% | Sun Dec 31 2023 | Official estimate |
![]() | 15,040 | 0.0002% | Thu Jul 01 2021 | 2021 Census |
![]() | 11,680 | 0.0001% | Sat Oct 30 2021 | 2021 Census |
![]() | 11,620 | 0.0001% | Mon Jul 24 2023 | 2023 census result |
![]() | 10,679 | 0.0001% | Thu Jul 01 2021 | National annual projection |
![]() | 10,585 | 0.0001% | Wed Jan 01 2020 | Official estimate |
![]() | 6,092 | 0% | Wed Jan 01 2020 | Official estimate |
![]() | 5,651 | 0% | Thu Jul 01 2021 | 2021 Census |
![]() | 4,386 | 0% | Sat Sep 23 2023 | 2023 census result |
![]() | 3,662 | 0% | Sun Oct 10 2021 | 2021 census result |
![]() | 2,188 | 0% | Fri Jan 01 2021 | 2021 Census |
![]() | 1,692 | 0% | Fri Jan 01 2021 | 2021 Census |
![]() | 1,681 | 0% | Fri Nov 11 2022 | 2022 Census |
![]() | 1,647 | 0% | Tue Jan 01 2019 | 2019 Census |
![]() | 764 | 0% | Mon Jun 26 2023 | Official figure |
![]() | 593 | 0% | Tue Jun 30 2020 | 2021 Census |
![]() | 35 | 0% | Sat Jul 01 2023 | Official estimate |