如何动态改变<asp:Table>的高度 只有通过JAVASCRPIT 写个循环试试。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 需要看table里边是否有行tr和单元格tr如果没有,那么只要用height就可以了 貌似xhtml不支持table的height属性 <tabel style="Widht:'<%=width%>'; Height:'<%=height%>'"></tabel> 在.net中直接用循环减少其高度不行吗,table1.height这里不是可以直接设置吗 <asp:Table id="Table1" style="Z-INDEX: 101; LEFT: 192px; POSITION: absolute; TOP: 80px" runat="server" Width="232px" Height="440px" BorderColor="#FF8080" BorderWidth="1px" GridLines="Both"> <asp:TableRow> <asp:TableCell>1</asp:TableCell> <asp:TableCell>1</asp:TableCell> </asp:TableRow> <asp:TableRow> <asp:TableCell>1</asp:TableCell> <asp:TableCell>1</asp:TableCell> </asp:TableRow> </asp:Table>---------我是这样做的,好像没有效果-------------------------------------------------------------------------private void Button1_Click(object sender, System.EventArgs e) { double d ; foreach(TableRow tr in this.Table1.Rows) { foreach(TableCell tc in tr.Cells) { d = tc.Height.Value; if(d >= 1) tc.Height = new System.Web.UI.WebControls.Unit(d - 1); } tr.Height = tr.Cells[0].Height; //new System.Web.UI.WebControls.Unit(0); d = Table1.Height.Value - tr.Cells[0].Height.Value;System.Threading.Thread.Sleep(1000); Table1.Height = new System.Web.UI.WebControls.Unit(d); } } 能对xml格式的字符串直接进行操作么? "确定/取消"功能基础问题(急) 如何定制ValidationSummary控件的输出格式? 数据返回怪问题 操作ACCESS数据库时问题不断!这和SQL数据库不一样啊,100分求助! .Net 奇怪的数据库问题!! 关于制作邮件系统的问题请教 请问下Devexpress控件在其他电脑上显示不出来怎么办? 问题 利用ASP.net在excel中画曲线图片 可以一个程序文件对应多个 aspx文件吗?
如果没有,那么只要用height就可以了
Width="232px" Height="440px" BorderColor="#FF8080" BorderWidth="1px" GridLines="Both">
<asp:TableRow>
<asp:TableCell>1</asp:TableCell>
<asp:TableCell>1</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>1</asp:TableCell>
<asp:TableCell>1</asp:TableCell>
</asp:TableRow>
</asp:Table>
---------我是这样做的,好像没有效果-------------------------------------------------------------------------
private void Button1_Click(object sender, System.EventArgs e)
{ double d ;
foreach(TableRow tr in this.Table1.Rows)
{
foreach(TableCell tc in tr.Cells)
{
d = tc.Height.Value;
if(d >= 1)
tc.Height = new System.Web.UI.WebControls.Unit(d - 1);
}
tr.Height = tr.Cells[0].Height; //new System.Web.UI.WebControls.Unit(0);
d = Table1.Height.Value - tr.Cells[0].Height.Value;
System.Threading.Thread.Sleep(1000);
Table1.Height = new System.Web.UI.WebControls.Unit(d);
}
}