Table2html
Hereafter are presented the available specific options for html tables from mathlayer® tables.
Table2html options
Options | Description | Values | Default Values |
styleTable | Specify the css style for the table. | Css style. | empty |
styleTableth | Specify the css style for the column names of the table. | Css style. | empty |
styleTabletd | Specify the css style for the elements of the table. | Css style. | empty |
styleTabletr | Specify the css style for the row names of the table. | Css style. | empty |
tableVN | Sets whether the column names will be shown or not. | true or false. | false |
tableRN | Sets whether the row names will be shown or not. | true or false. | false |
tdAlign | Specify the align of the text inside the cells. | 'center', 'right', 'left'. | 'center' |
Name = {'John';'Marc';'Sam';'Toni';'Anna';'Sara';'Paula'}; Grades = {'B';'A';'B';'F';'A';'M';'G'}; DOB = {'02-Jun-2012';'12-Feb-2012';'04-Oct-2011';'29-Aug-2012';'06-Sep-2012';'11-Nov-2012';'29-Dec-2012'} Num = {'1';'2';'3';'4';'5';'6';'7'} T = table(Name,Grades,DOB,'rownames',Num)% defining a table
options = struct% initializing options struct
options.styleTable = 'border-collapse:collapse;border:1px solid black; width:70%;font:10px arial;margin-top:20px;' options.styleTableth = 'background-color: #f2f2f2;border: 1px solid black;' options.styleTabletd = 'padding: 5px;border:1px solid DimGray;font-size: 0.85em;' options.tableVN = true options.tableRN = true table2html(T,options)
Name | Grades | DOB | |
---|---|---|---|
1 | John | B | 02-Jun-2012 |
2 | Marc | A | 12-Feb-2012 |
3 | Sam | B | 04-Oct-2011 |
4 | Toni | F | 29-Aug-2012 |
5 | Anna | A | 06-Sep-2012 |
6 | Sara | M | 11-Nov-2012 |
7 | Paula | G | 29-Dec-2012 |