let mut grid = zakgrid::Grid::new();
+ grid.set_header_tmpl(String::from("<tr style='border: 1px solid;'>\n{{ row }}</tr>\n"));
+ grid.set_header_row_tmpl(String::from("\t<th style='border: 1px solid;'{% if align == \"Center\" %} align='center'{% elif align == \"Right\" %} align='right'{% endif %}>{{ title }}</th>\n"));
+
let mut s = String::new();
s.push_str("<html>");
}
s.push_str("<br/><br/>\n");
- s.push_str("<table>\n");
+ s.push_str("<table style='border: 1px solid;'>\n");
let header = grid.header();
s.push_str(header.as_str());
s.push_str("</table>\n");
}
}
+ pub fn set_header_tmpl(&mut self, tmpl: String) {
+ self.header_tmpl = tmpl;
+ }
+
+ pub fn set_header_row_tmpl(&mut self, tmpl: String) {
+ self.header_row_tmpl = tmpl;
+ }
+
pub fn add_column(&mut self, col: Column) {
self.columns.push(col);
}