Reputation: 1458
in a Grid example of 2012 the grid border is simply set with:
TableElement _table;
_table = new Element.tag("table");
_table.border="1";
unfortunaltly border is no longer (running vers. 1.1.1) a setter in DART's TableElement class. Leaving it out results in a table without borders. How do I set a border?
Upvotes: 0
Views: 222
Reputation: 3620
This works for me
import 'dart:html';
void main() {
TableElement q = querySelector('table');
q.style
..border = '100px solid black';
}
Edit:
Ok I found out what's wrong, you are creating a new TableElement
, not querying it from the dom:
TableElement _table;
_table = new Element.tag("table");
_table.style.border="100px solid black";
querySelector('body').append(_table); // add this line
Upvotes: 1
Reputation: 2927
TableElement _table = new TableElement()
..setAttribute('border','1');
querySelector('body').append(_table);
or this should work also... I think
querySelector('body').append(new TableElement().setAttribute('border','1'));
Upvotes: 1