<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> Fill in table data </title>
<Script type = "text/javascript">
<! --
Function fillTableData (cols, height)
{
Var trData = document. getElementById ("tab_data ");
Var tabObj = document. getElementById ("dataTable ");
If (trData! = Null)
{
// Set the colspan of the header Column
TabObj. rows [0]. cells [0]. colSpan = cols;
// Set the column height
Height = height | 30;
// Fill in data
Var tds = trData. cells;
Var newtr = null;
Var times = 0;
While (tds. length> 0)
{
If (times % cols = 0)
{
Newtr = tabObj. insertRow (trData. rowIndex );
Newtr. style. backgroundColor = "# ffffff ";
Newtr. style. height = parseInt (height) + "px ";
}
Tds [0]. style. width = (100/cols). toFixed (1) + "% ";
Newtr. appendChild (tds [0]);
Times ++;
}
// Complete the td of the last row
For (var I = newtr. cells. length; I <cols; I ++)
{
Var newtd = newtr. insertCell (-1 );
Newtd. innerHTML = "& nbsp ";
Newtd. style. width = 100/cols + "% ";
}
}
TrData. parentNode. removeChild (trData );
}
Window. onload = function ()
{
FillTableData (4, 30 );
};
// -->
</Script>
</Head>
<Body>
<Table id = "dataTable" style = "width: 98%; border-width: 0px; background-color: # cccccc;" cellpadding = "0" cellspacing = "1">
<Tr>
<Th style = "text-align: center; background-color: # f1f5fe; height: 30px"> time </th>
</Tr>
<Tr id = "tab_data" style = "display: none">
<Td title = "2000-01"> <a href = "#"> 2000-01 </a> </td>
<Td title = "2000-02"> <a href = "#"> 2000-02 </a> </td>
<Td title = "2000-03"> <a href = "#"> 2000-03 </a> </td>
<Td title = "2000-04"> <a href = "#"> 2000-04 </a> </td>
<Td title = "2000-05"> <a href = "#"> 2000-05 </a> </td>
<Td title = "2000-06"> <a href = "#"> 2000-06 </a> </td>
<Td title = "2000-07"> <a href = "#"> 2000-07 </a> </td>
<Td title = "2000-08"> <a href = "#"> 2000-08 </a> </td>
<Td title = "2000-09"> <a href = "#"> 2000-09 </a> </td>
<Td title = "2000-10"> <a href = "#"> 2000-10 </a> </td>
<Td title = "2000-11"> <a href = "#"> 2000-11 </a> </td>
<Td title = "2000-12"> <a href = "#"> 2000-12 </a> </td>
<Td title = "2001-01"> <a href = "#"> 2001-01 </a> </td>
</Tr>
</Table>
</Body>
</Html>