Style for table UI component
Use Style
objects to create color, font, and alignment styles
for cells in table UI components. The table UI component must be one that is parented to a
figure created with the uifigure
function, or to one of its child
containers. You can create a Style
object using the
uistyle
function, specify its properties, and then apply it to the
table using the addStyle
function. You can remove styles from a table
using the removeStyle
function.
Style
objects that you add to the
table UI component take visual precedence over properties you set on the
Table
object, no matter the order in which you created them. For
example, in this code the blue font color displays in the table even though red foreground
color was set on the Table
object last.
uit = uitable(uifigure,'Data',rand(100,10)); s = uistyle; s.FontColor = 'blue'; addStyle(uit,s); uit.ForegroundColor = 'red';