Set different colors of FormalTable header labels

8 ビュー (過去 30 日間)
Marco Dal Corso
Marco Dal Corso 2023 年 2 月 10 日
回答済み: Rahul Singhal 2023 年 2 月 10 日
In a Report I have a table containing the value of 3 ratios, each one for right and left side, and I would like the "R" hader to be red, and the "L" one to be blue, but setting the Header.Style I can only define one color. Is there the possibility to define two different colors?
headerLabels=["R","L"];
FRRt=FormalTable(headerLabels,FRRdata);
RLtableHeaderStyles = {Bold(true),Color('red','blue')};
FRRt.Header.Style = [FRRt.Header.Style, RLtableHeaderStyles];

採用された回答

Rahul Singhal
Rahul Singhal 2023 年 2 月 10 日
Hi Marco,
Yes, you can customize individual entries in the table header, as shown below:
headerLabels = ["R","L"];
FRRt = FormalTable(headerLabels,FRRdata);
% Specify table header to be bold
tableHeader = FRRt.Header;
tableHeader.Style = [tableHeader.Style, {Bold(true)}];
% Specify header's first entry to be red
entry11 = tableHeader.entry(1,1);
entry11.Style = [entry11.Style, {Color("red")}];
% Specify header's second entry to be blue
entry12 = tableHeader.entry(1,2);
entry12.Style = [entry12.Style, {Color("blue")}];
Thanks,
Rahul

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by