public static string CellToHtml(LightweightCell cell)
        {
            if (cell is PlaintextCell)
            {
                PlaintextCell cur = (PlaintextCell)cell;
                return(FormatText(cur.Text, cur.Kind, CssHelper.GenericPositiveCssClass, CssHelper.GenericNegativeCssClass));
            }
            else if (cell is HyperlinkCell)
            {
                HyperlinkCell cur = (HyperlinkCell)cell;
                int           id  = cur.LinkObjectID;
                string        url = string.Empty;

                switch (cur.LinkType)
                {
                case HyperlinkCell.LinkObjectType.Contest:
                    url = UrlRenderer.RenderContestUrl(id);
                    break;

                case HyperlinkCell.LinkObjectType.Monitor:
                    url = UrlRenderer.RenderMonitorUrl(id);
                    break;

                case HyperlinkCell.LinkObjectType.Problem:
                    url = UrlRenderer.RenderProblemUrl(id);
                    break;

                case HyperlinkCell.LinkObjectType.Submission:
                    url = UrlRenderer.RenderTestlogUrl(id);
                    break;

                default:
                    throw new ArgumentException(string.Format("Invalid link object type {0}", cur.LinkType));
                }

                return(string.Format("<a href='{0}'>{1}</a>", HttpContext.Current.Request.MapPath(url), cur.Text));
            }
            else if (cell is OutcomeInfoCell)
            {
                OutcomeInfoCell cur = (OutcomeInfoCell)cell;

                return(FormatText(cur.Info.PrintableValue, cur.Info.Kind, CssHelper.GenericPositiveCssClass,
                                  CssHelper.GenericNegativeCssClass));
            }
            else if (cell is MonitorCell)
            {
                MonitorCell cur = (MonitorCell)cell;

                string ret = FormatText(cur.Text, cur.Kind, CssHelper.MonitorPositiveCssClass,
                                        CssHelper.MonitorNegativeCssClass);

                if (cur.ShowTime)
                {
                    ret += string.Format("<span class='{0}'>{1}</span>", CssHelper.TimeSpanCssClass,
                                         TimeUtils.BeautifyTimeSpan(cur.Time, true));
                }

                return(ret);
            }
            else
            {
                throw new ArgumentException(string.Format("Invalid cell type {0}", cell.GetType()));
            }
        }