Repeater one-line multiple-record solutions

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Fill 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 of the table
Tabobj.rows[0].cells[0].colspan=cols;
Set column height
height=height| | 30;
Populating 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 last line of TD
for (Var i=newtr.cells.length;i<cols;i++)
{
var Newtd=newtr.insertcell (-1);
Newtd.innerhtml= "&AMP;NBSP";
newtd.style.width=100/cols+ "%";
}
}
TrData.parentNode.removeChild (TRDATA);
}
Window.onload=function ()
{
Filltabledata (4,30);
};
-->
</script>
<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" >
&LT;TD title= "2000-01" ><a href= "#" >2000-01</a></td>
&LT;TD title= "2000-02" ><a href= "#" >2000-02</a></td>
&LT;TD title= "2000-03" ><a href= "#" >2000-03</a></td>
&LT;TD title= "2000-04" ><a href= "#" >2000-04</a></td>
&LT;TD title= "2000-05" ><a href= "#" >2000-05</a></td>
&LT;TD title= "2000-06" ><a href= "#" >2000-06</a></td>
&LT;TD title= "2000-07" ><a href= "#" >2000-07</a></td>
&LT;TD title= "2000-08" ><a href= "#" >2000-08</a></td>
&LT;TD title= "2000-09" ><a href= "#" >2000-09</a></td>
&LT;TD title= "2000-10" ><a href= "#" >2000-10</a></td>
&LT;TD title= "2000-11" ><a href= "#" >2000-11</a></td>
&LT;TD title= "2000-12" ><a href= "#" >2000-12</a></td>
&LT;TD title= "2001-01" ><a href= "#" >2001-01</a></td>
</tr>
</table>
</body>

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.