pub fn to_html(table: &ExportTable, options: &HtmlOptions) -> StringExpand description
Writes the table as HTML.
Column groups become the header’s upper rows, a group’s heading a row of its
own, and aggregates rows that say what they are (Sum €7,300.50). Values are
the text the grid shows: a page is read, not parsed.
use datagrid_core::{ExportCell, ExportColumn, ExportRow, ExportTable};
use datagrid_export::{HtmlOptions, to_html};
let table = ExportTable {
columns: vec![ExportColumn::new("note", "Note")],
rows: vec![ExportRow::Data(vec![ExportCell {
value: None,
text: "<b>&</b>".into(),
}])],
};
let html = to_html(&table, &HtmlOptions::default());
assert!(html.contains("<b>&</b>"));
assert!(!html.contains("<b>"));