Search code examples
htmldynamicdartcellhtml-table

dart HTML TableCellElement - cannot get or set colspan


I am creating a HTML table inside the dart code. then i add rows to the table (TableRowElement) and cells (TableCellElement) to the rows. Then I want to set the colspan of the cells. Or even print the colspan.

Here the program crashes (debugger says that the element has no get$colspan). However the API reference (http://api.dartlang.org/docs/channels/stable/latest/dart_html/TableCellElement.html#colSpan) shows colspan as an int (its not final either).

At the end, I want to create dynamic tables...

Thanks, imran

p.s.: code looks like this:

  var table = new TableElement();
  table.addRow();
  table.rows.last.addCell();
  print(table.rows.last.cells.last.colspan);
  table.rows.last.cells.last.colspan=2;

Solution

  • The property is colSpan (capital S)