Results for “Arrays & embedded state”
Small, practical examples. Search by task or narrow things down below.
Show a group total beside each detail row
SQLite: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.
SQLite✓ Tested
Show keyboard focus
Use a visible CSS outline when an input receives keyboard focus.
CSS✓ Tested
Sort numbers numerically
Supply a numeric comparator instead of JavaScript string sorting.
JavaScript✓ Tested
Sort preferred rows ahead of other rows
SQL: A CASE ordering key expresses business priority before a stable secondary sort.
SQL✓ Tested
Sort preferred rows ahead of other rows
SQL Server: A CASE ordering key expresses business priority before a stable secondary sort.
SQL Server✓ Tested
Sort preferred rows ahead of other rows
Postgres: A CASE ordering key expresses business priority before a stable secondary sort.
Postgres✓ Tested
Sort preferred rows ahead of other rows
SQLite: A CASE ordering key expresses business priority before a stable secondary sort.
SQLite✓ Tested
Sort version-like labels naturally
Linux Commands: Use GNU version sort to compare embedded digit runs numerically.
Linux Commands✓ Tested
Space items with gap
Use CSS gap instead of margins between flex children.
CSS✓ Tested
Split values into fixed-size chunks
C#: Enumerable.Chunk creates arrays and allows a shorter final chunk.
C#✓ Tested
Stack columns on small screens
Change a two-column CSS grid to one column at a viewport breakpoint.
CSS✓ Tested
Start a disclosure open while keeping it collapsible
HTML: The open attribute sets the initial details state without JavaScript.
HTML✓ Tested