How to Sort a Table in Google Docs™ (and Keep the Header Row in Place)
Sort a Google Docs™ table alphabetically or numerically with two clicks — and pin your header rows first so they don't get sorted into the data.
Travis
Right-click anywhere in the column you want to sort and choose 'Sort table' > ascending or descending. Pin your header rows first — pinned rows are excluded from sorting, so your column titles stay at the top.
Sorting used to require copying the table out to Google Sheets™ and back. Docs™ can now do it directly — but the number-one mistake is sorting the header row into the middle of the data. Do these two steps in order.
Step 1: Pin the header row
- Click into the header row (the row with your column titles).
- Right-click and choose Pin header up to this row.
- A pin indicator appears on the row edge. Pinned rows repeat on every page for multi-page tables — and, crucially, they are excluded from sorting.
You can also manage this via Format > Table > Table properties under the row settings.
Step 2: Sort the table
- Right-click anywhere inside the column you want to sort by.
- Choose Sort table, then Sort table ascending or Sort table descending.
- All non-pinned rows reorder by that column's values.
Sorting is alphabetical for text and numerical for numbers. Mixed columns (like Item 2, Item 10) sort as text, so Item 10 comes before Item 2 — pad numbers with zeros if the order matters.
When Docs™ sorting isn't enough
Docs™ sorts by a single column, one level. If you need multi-column sorting, filters, or formulas, take the table to Google Sheets™: copy it, paste into a sheet, sort with Data > Sort range, and paste the result back into your Doc.
Watch out for merged cells in the data area — they confuse sorting in both Docs™ and Sheets™. Keep merges to header rows only.
Bonus: reorder the table itself
Sorting rearranges rows by value. If you instead want to flip rows and columns (transpose) or rotate the table, the free Text To Table Converter Add-On does it in place: Extensions > Text To Table Converter > Modify Table > Transpose Table.
Get the Add-On
Отримати додаток безкоштовно
Text To Table Converter
More table power, for free: The free Text To Table Converter add-on adds transpose, rotation, one-click styles, and text-to-table conversion to Docs™, Slides™, and Sheets™.
Next Step: Rearranging Tables Physically
- How to Split, Move, and Copy Tables in Google Docs™ - Break one table into two, move a table elsewhere in the document, and duplicate it safely.