|Why aren't my style changes reflected in the Results window?
|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
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.
Classroom and web training
Teaching with Stata
Statalist: The Stata Forum
Last updated: 16 November 2022
StataCorp LLC (StataCorp) strives to provide our users with exceptional products and services. To do so, we must collect personal information from you. This information is necessary to conduct business with our existing and potential customers. We collect and use this information only where we may legally do so. This policy explains what personal information we collect, how we use it, and what rights you have to that information.
These cookies are essential for our website to function and do not store any personally identifiable information. These cookies cannot be disabled.
Please note: Clearing your browser cookies at any time will undo preferences saved here. The option selected here will apply only to the device you are currently using.