diff --git a/JavaSource/org/unitime/commons/web/WebTable.java b/JavaSource/org/unitime/commons/web/WebTable.java index 9afc61c933..f068786c3b 100644 --- a/JavaSource/org/unitime/commons/web/WebTable.java +++ b/JavaSource/org/unitime/commons/web/WebTable.java @@ -86,6 +86,7 @@ public class WebTable { protected boolean iBlankWhenSame = false; protected WebTableTweakStyle iWebTableTweakStyle = null; + protected WebTableCellStyle iWebTableCellStyle = null; /** creates a WebTable instance */ public WebTable(int columns, String name, String[] headers, String[] align, boolean[] asc) { @@ -114,11 +115,20 @@ public void setWebTableTweakStyle(WebTableTweakStyle style) { iWebTableTweakStyle = style; } + public void setCellStyle(WebTableCellStyle style) { + iWebTableCellStyle = style; + } + public String getStyle(WebTableLine line, WebTableLine next, int order) { String style = (iRowStyle==null?"":iRowStyle+";")+(iWebTableTweakStyle==null?"":iWebTableTweakStyle.getStyleHtml(line, next, order)); return (style==null || style.length()==0? "" : "style=\""+style+"\""); } + public String getCellStyle(WebTableLine line, int column, String defaultStyle) { + String style = (iWebTableCellStyle == null ? null : iWebTableCellStyle.getCellStyleHtml(line, column)); + return (style == null ? defaultStyle : "style=\""+style+"\""); + } + /** sets row (cell) style */ public void setRowStyle(String style) { iRowStyle = (iRowStyle == null ? "" : iRowStyle + ";") + style; @@ -369,7 +379,7 @@ public String printTable(int ordCol) { blank=false; if (!blank && line[i] != null) { sb.append("