フィルターのクリア

How can i create such a table in Report Generator?

22 ビュー (過去 30 日間)
Tong Wang
Tong Wang 2018 年 7 月 21 日
コメント済み: Tong Wang 2018 年 7 月 24 日
i would like to creat a table like this, as you can see, the left side is a big image, and the second and third column are full of texts, i thought RowSpan could fix this.
I created firstly a 1*3 table, then use RowSpan to span the second and third entry,and an error goes to
'A table-cell is spanning more rows than available in its parent element.'
ok, i can understand this, but then i tried also other methods, they just didn't work... It would be great if i can get some tipps from you
Thanks
  1 件のコメント
Tong Wang
Tong Wang 2018 年 7 月 23 日
Or can i somehow directly insert a column on the right side? But Report Generator seems doesn't have this property...

サインインしてコメントする。

採用された回答

Krishnan Ramkumar
Krishnan Ramkumar 2018 年 7 月 23 日
編集済み: Krishnan Ramkumar 2018 年 7 月 23 日
Hello Tong,
You can create an empty DOM Table and then create DOM TableRows and DOM TableEntries. Append the TableEntries to the TableRows and then the TableRows to the Table. For the first TableEntry alone set the RowSpan value. The documentation link for TableRows and TableEntries can be found below:
Also below is the sample code snippet to do create Table like the above one
import mlreportgen.dom.*
d = Document('sample', 'html-file');
i = Image(which('peppers.png'));
t = Table();
t.Border = 'Solid';
t.RowSep = 'Solid';
t.ColSep = 'Solid';
% Create First Table Row
tr = TableRow();
te = TableEntry();
% Setting the RowSpan for the first TableEntry to 3
te.RowSpan = 3;
append(te,i);
append(tr,te);
te = TableEntry();
append(te,'Text');
append(tr,te);
te = TableEntry();
append(te,'Text');
append(tr,te);
append(t,tr);
% Create Second Table Row
tr = TableRow();
te = TableEntry();
append(te,'Text');
append(tr,te);
te = TableEntry();
append(te,'Text');
append(tr,te);
append(t,tr);
% Create Third Table Row
tr = TableRow();
te = TableEntry();
append(te,'Text');
append(tr,te);
te = TableEntry();
append(te,'Text');
append(tr,te);
append(t,tr);
append(d,t);
close(d);
rptview(d);
Regards, Krishnan,
  1 件のコメント
Tong Wang
Tong Wang 2018 年 7 月 24 日
Thx, this works well!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by