public XElement generate(TableModel model)
        {
            checkModel(model);
            var table = new XElement(XmlNs.XHTMLNS + "table",
                    new XAttribute("border", "0"),
                    new XAttribute("cellspacing", "0"),
                    new XAttribute("cellpadding", "0"),
                    new XAttribute("style", "border: 0px; font-size: 11px; font-family: verdana; vertical-align: top;"));

            var tr = new XElement(XmlNs.XHTMLNS + "tr",
                new XAttribute("style", "border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;"));

            table.Add(tr);

            foreach (Title t in model.Titles)
            {
                var tc = renderCell(tr, t, "th", null, null, false, null);
            }

            foreach (Row r in model.Rows)
            {
                renderRow(table, r, 0, new List<bool>());
            }

            return table;
        }
 private void checkModel(TableModel model)
 {
     check(model.getRows().Any(), "Must have rows");
     check(model.getTitles().Any(), "Must have titles");
     foreach (Cell c in model.getTitles())
         check(c);
     foreach (Row r in model.getRows())
         check(r, "rows", model.getTitles().Count);
 }
        public TableModel initNormalTable()
        {
            TableModel model = new TableModel();

            model.getTitles().Add(new Title(null, null, "Name", null, null, 0));
            model.getTitles().Add(new Title(null, null, "Card.", null, null, 0));
            model.getTitles().Add(new Title(null, null, "Type", null, null, 100));
            model.getTitles().Add(new Title(null, null, "Description & Constraints", null, null, 0));
            return model;
        }
         public static TableModel CreateNormalTable()
         {
             TableModel model = new TableModel();

             model.Titles.Add(new Title(null, null, "Name", null, null, 0));
             model.Titles.Add(new Title(null, null, "Card.", null, null, 0));
             model.Titles.Add(new Title(null, null, "Type", null, null, 100));
             model.Titles.Add(new Title(null, null, "Description & Constraints", null, null, 0));
             return model;
         }