lsmith / yui3

YUI 3.x Source Tree
http://developer.yahoo.com/yui/3/
Other
7 stars 0 forks source link

Example: absolute column widths #25

Closed lsmith closed 11 years ago

lsmith commented 12 years ago

Either a cellTemplate or string formatter that includes a <divc lass="yui3-datatable-liner"> around the cell content. Assign column config 'width', and assign the same width - 20px to the CSS of the liner div class. E.g.

.yui3-datatable-col-foo .yui3-datatable-liner { width: 80px; }
.yui3-datatable-col-bar .yui3-datatable-liner { width: 130px; }
var template = '<td class="{className}"><div class="yui3-datatable-liner">{content}</div></td>';
var table = new Y.DataTable({
    columns: [ { key: 'foo', cellTemplate: template, width: '100px' }, { key: 'bar', cellTemplate: template, width: '150px' } ],
    ...
});