How to change in terminal the background color of tab space "\t" by C\C ++

Viewed 82

I wrote a program in C++ that shows a data table in the terminal. The values are of different lengths, so to arrange them in columns I use "\t" to print a tab space. When try to change the background color of some row, the tab space remain in black background (the default background).

An example of the problem:

Code:

cout << "\033[46mHello\tWorld\033[0m";

Actual output: enter image description here

Output I want: enter image description here

0 Answers
Related