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 (1978 automobile data) . 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.
Learn
Free webinars
NetCourses
Classroom and web training
Organizational training
Video tutorials
Third-party courses
Web resources
Teaching with Stata
© Copyright 1996–2024 StataCorp LLC. All rights reserved.
×
We use cookies to ensure that we give you the best experience on our website—to enhance site navigation, to analyze usage, and to assist in our marketing efforts. By continuing to use our site, you consent to the storing of cookies on your device and agree to delivery of content, including web fonts and JavaScript, from third party web services.
Cookie Settings
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.
This website uses cookies to provide you with a better user experience. A cookie is a small piece of data our website stores on a site visitor's hard drive and accesses each time you visit so we can improve your access to our site, better understand how you use our site, and serve you content that may be of interest to you. For instance, we store a cookie when you log in to our shopping cart so that we can maintain your shopping cart should you not complete checkout. These cookies do not directly store your personal information, but they do support the ability to uniquely identify your internet browser and device.
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.