How to sort table with background colors

I have a table which has 4 columns. I want to sort the table by the third column. It works fine except for one thing. The cells of the first column have different background colors. Although the text is reordered according to the sort order, the background colors remain in the same locations are before. In other words, the textual content is sorted, but not the cell background color attribute.

Is there a way to have the background color be attached to the text?

Thanks,
Robert

You will have to set the Paragraph background, not the cell. I have shown direct formatting which is fine for a short document or while designing a look, paragraph styles would be better and safer for longer documents or shared documents

TableParagraphColour76047.odt (9.6 KB)

EarnestAl,

ahaaa!!! Thank you so much for your help. Now I understand how to do it. It’s too bad that I already did the table with a few hundred rows. Now I have to manually change all of the colored cells to colored paragraphs. I had assumed that the background cell color would stay with the content, but it actually stays with the cell. Now I understand that it’s the paragraph that that gets moved around during sorting, not the cell. So your solution makes sense.

Thanks again,
Robert