Using the Grid object of ActionScript, the method of actualizing the table tag of html falsely
table.mxml
<? xml version= " 1.0 " encoding= " utf-8 "? >
<mx: Application xmlns: mx= " http://www.adobe.com/2006/mxml " width= " 500 " height= " 300 " layout= " absolute " creationComplete= " main () “>
<mx: Script source= ". /table.as "/>
</mx: Application>
table.as
// ActionScript file
import mx.
import mx.containers.GridItem;
import mx.containers.GridRow;
import mx.controls. Label;
public function main (): void {
// grid definition <table>
var grid: Grid = new Grid ();
grid.width=400
grid.setStyle ('borderStyle' and 'inset');
grid.setStyle ('borderColor' and 'grey');
for (var i: int = 0; i<5; i++)
{
// line definition <tr>
var gridRow: GridRow = new GridRow ();
for (var j: int = 0; j<5; j++)
{
// line definition <td>
var gridItem: GridItem = new GridItem ();
var label: Label = new Label ();
gridItem.addChild (label);
label.text = 'test';
// line addition </td>
gridRow.addChild (gridItem);
}
// line addition </tr>
grid.addChild (gridRow);
}
//
addChild (grid);
}
|