Home  /  Resources & support  /  FAQs  /  Why aren't my style changes reflected in the Results window?

Why can't I observe the style changes (background shading, font, etc.) in my table in the Results window?

Title   Why aren't my style changes reflected in the Results window?
Author Mia Lv, StataCorp

When customizing table styles, you might notice that the table in the Results window looks plain—it does not reflect the color or some font changes you just made. Why?

Consider this example:

. clear all

. sysuse auto

. table rep78, statistic(mean mpg price)

. collect style cell cell_type[column-header], shading( background(aqua))

. collect style cell result[mean], font(, underline(single))

. collect layout

Our goal is to produce a table that looks like:

But the table appears as follows in the Results window:

. collect layout

Collection: Table
      Rows: rep78
   Columns: result#var
   Table 1: 7 x 2

Mileage (mpg) Price
Repair record 1978
1 21 4564.5
2 19.125 5967.625
3 19.43333 6429.233
4 21.66667 6071.5
5 27.36364 5913
Total 21.28986 6146.043

It doesn't display the shading color or the underline. Why? The Results window displays Stata commands and output in SMCL, and not all styles are supported by SMCL (although it does show some, such as bold and italic font).

If you are using Windows or Mac, the style changes you make can be reflected in the Tables Builder and will be consistent with the exported files. To open the Tables Builder, select the following menu items:

Statistics > Summaries, tables, and tests > Tables and collections > Build and style table

or simply type

. db tables

in the Command window.

In this case, the Tables Builder will look like

The Preview window within the Tables Builder uses HTML and web view, therefore; it is capable of displaying all the styles. Now let’s export this table to a .docx file and view the exported document:

. collect export "myfile.docx", replace

The style of the exported table is consistent with what appears in the Tables Builder.

Stata for Linux uses plain text for its Tables Builder, therefore you won't see most of your style changes reflected in the Tables Builder. But you can view these changes in the file you export your tables to.