GOOGLE下发现有许多创建双行跨列的DATAGRID表头的文章.大部分是利用在Pager创建时将Pager列去掉而和Header一起形成两行表头(注Pager会在Header前先建立) 如[http://dev.csdn.net/develop/article/18/18971.shtm]自己也认真学习了一天,发现DATAGRID实际上还是table,所以我就只用DATALIST实现就可以搞贴再加个分页函数,完全OK. <asp:datalist id="MainDataList" runat="server" BorderWidth="0px" CellPadding="0" BorderStyle="None" GridLines="Horizontal" RepeatLayout="Flow" RepeatDirection="Horizontal"> <HeaderTemplate> <TABLE style="BORDER-RIGHT: #cccccc 1px; BORDER-TOP: #cccccc 1px; BORDER-LEFT: #cccccc 1px; BORDER-BOTTOM: #cccccc 1px; BORDER-COLLAPSE: collapse" borderColor="#cccccc" cellSpacing="0" cellPadding="0" rules="all" border="1"> <TR class="red_99" style="FONT-WEIGHT: bold; COLOR: white; HEIGHT: 30px; BACKGROUND-COLOR: #3399cc" align="center"> <TD width="100" rowSpan="2"> <DIV align="center" class="white_99">小区</DIV> </TD> <TD width="100" rowSpan="2"> <DIV align="center" class="white_99">大楼</DIV> </TD> <TD width="100" rowSpan="2"> <DIV align="center" class="white_99">房号</DIV> </TD> <TD width="70" rowSpan="2"> <DIV align="center" class="white_99">底数</DIV> </TD> <TD colSpan="3" height="22"> <DIV align="center" class="white_99">本月应收</DIV> </TD> <TD colSpan="2" height="22"> <DIV align="center" class="white_99">实收</DIV> </TD> <TD colSpan="2" height="22"> <DIV align="center" class="white_99">累欠</DIV> </TD> </TR> <TR class="red_99" style="FONT-WEIGHT: bold; COLOR: white; HEIGHT: 30px; BACKGROUND-COLOR: #3399cc" vAlign="bottom" align="center" class="white_99"> <TD width="60" height="21"> <DIV align="center" class="white_99">抄表</DIV> </TD> <TD width="55" height="21"> <DIV align="center" class="white_99">用量</DIV> </TD> <TD width="70" height="21"> <DIV align="center" class="white_99">金额</DIV> </TD> <TD width="60" height="21"> <DIV align="center" class="white_99">数量</DIV> </TD> <TD width="60" height="21"> <DIV align="center" class="white_99">金额</DIV> </TD> <TD width="55" height="21"> <DIV align="center" class="white_99">数量</DIV> </TD> <TD width="70" height="21"> <DIV align="center" class="white_99">金额</DIV> </TD> </TR> </HeaderTemplate> <FooterTemplate> </table> </FooterTemplate> <ItemStyle BorderWidth="0px" BorderStyle="None" BackColor="#FFFFFF"></ItemStyle> <ItemTemplate> <tr bgcolor="<%# strBgcolor%>">> private void MainDataList_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) } 相关文章: 2021-11-18 2021-12-28 2022-12-23 2021-06-07 2021-08-11 2021-07-30 2022-12-23