View Single Post
  #1   Report Post  
Dan Corban
 
Posts: n/a
Default Sorting a table while keeping some related rows together

I have a table with two columns. The first column has names of items, each
item in its own row. I indent the items (using styles) if they are related to
the item directly above it. I want to sort this table, keeping the indented
item below the related item. I can't figure out how to do this. The indented
items just get sorted normally and end up separated from the related name.

An example of my table before sorting:
Lamp
Book
Moby Dick
Desk

When I sort, it looks like this:
Book
Desk
Lamp
Moby Dick

I want it to end up looking like this:
Book
Moby Dick
Desk
Lamp

Any idea how I can accomplish this (other than manually sorting)?