mlreportgen.dom.BorderCollapse class

Package: mlreportgen.dom
Superclasses:

Collapse HTML table borders

Description

Specifies whether to collapse table borders. This class applies only to HTML tables.

Construction

borderCollapseObj = BorderCollapse() creates an unspecified format. Nothing is inserted in the generated table markup.

borderCollapseObj = BorderCollapse(value) creates a border collapse object having the specified value.

Input Arguments

expand all

Setting to specify whether to collapse table borders, specified as 'on' to collapse or 'off' to leave the table and adjacent cell borders separate.

Output Arguments

expand all

Specify whether to collapse table borders, represented by an mlreportgen.dom.BorderCollapse object.

Properties

expand all

ID for this document element, specified as a character vector. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Tag for the document element, specified as a character vector.

The DOM generates a session-unique tag when it creates the document element. Structure the tag as class:id, where class is the class of the element and id is the value of the Id property. You can specify a tag to replace the generated tag. Specifying your own tag can make it easier to identify where an issue occurred during document generation.

Setting to specify whether to collapse table borders, specified as 'on' to collapse or 'off'to leave the table and adjacent cell borders separate.

Examples

collapse all

import mlreportgen.dom.*;
doctype = 'html';
d = Document('test',doctype);

magicArray = magic(5);

p = Paragraph('Collapsed Borders');
append(d,p);
table = Table(magicArray);
table.Style = {Border('solid'),BorderCollapse('on')};
     for r = 1:5
         for c = 1:5
             table.entry(r,c).Style = {Border('solid')}; 
         end
     end
append(d,table);
     
p = Paragraph('Separate Borders');
append(d,p);
table = Table(magicArray);
table.Style = {Border('solid'),BorderCollapse('off')};
     for r = 1:5
         for c = 1:5
             table.entry(r,c).Style = {Border('solid')}; 
         end
     end
append(d,table);
     
close(d);
rptview(d.OutputPath,doctype);