Main Content

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 or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Tag for this document element, specified as a character vector or string scalar.

The DOM generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Specifying your own tag value can help you 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);