只有通过JAVASCRPIT 写个循环试试。。

解决方案 »

  1.   

    需要看table里边是否有行tr和单元格tr
    如果没有,那么只要用height就可以了
      

  2.   

    貌似xhtml不支持table的height属性
      

  3.   

    <tabel style="Widht:'<%=width%>'; Height:'<%=height%>'"></tabel>
      

  4.   

    在.net中直接用循环减少其高度不行吗,table1.height这里不是可以直接设置吗
      

  5.   

    <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); 

    }
    }