Solution for multiple record entries in a Repeater row

Source: Internet
Author: User

<! 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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.