Can individual ColSep('solid') & RowSep('solid') be defined in mlreportgen.dom.(Formal)Table?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
John
el 18 de Sept. de 2020
Respondida: Rahul Singhal
el 21 de Sept. de 2020
From Matlab examples on mlreportgen.dom.Table and mlreportgen.dom.FormalTable, the border of cells are overall defined:
tableStyle = {Width('100%'), Border('solid'), ColSep('solid'), RowSep('solid')};
t = FormalTable(data);
t.Style = [t.Style tableStyle];
t.Body.TableEntriesStyle = [t.Body.TableEntriesStyle, bodyStyle];
and
formalTable = mlreportgen.dom.FormalTable(tbl_header,traffic_camera_data);
formalTable.RowSep = "Solid";
formalTable.ColSep = "Solid";
formalTable.Border = "Solid";
Can the border of each table cell be defined individually? For example, some cell with only the bottom border.
Thanks.
0 comentarios
Respuesta aceptada
Rahul Singhal
el 21 de Sept. de 2020
Hi John,
Yes, borders can be defined for each table entry individually. This can be done by adding the Border format to that particular table entry. Doing this will override any border settings coming from the table borders, rowsep, or colsep for that entry.
Below is a sample script:
% Create a report
import mlreportgen.dom.*;
d = Document('myreport','pdf');
open(d);
% Create a table with solid borders. Also specify solid row and column separators.
t = FormalTable(magic(4));
t.Border = 'solid';
t.ColSep = 'solid';
t.RowSep = 'solid';
% Override borders for a particular table entry (second entry in second row)
te22 = t.Body.entry(2,2);
te22.Style = [te22.Style {Border('double','red','2pt')}];
% Append table to the report
append(d,t);
% Close and view the report
close(d);
rptview(d);
Below is the sample output snapshot:
Thanks,
Rahul
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre MATLAB Report Generator en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!