css表高度始终相同

时间:2014-04-09 13:29:46

标签: asp.net css

我有这张桌子

<table class="style1" cellpadding="0" cellspacing="0">
    <tr class="style4">
        <td class="style23">
            Inbound Calls
        </td>
        <td class="style20">
         <span style="vertical-align:middle" runat="server" id="spInBC"></span>

        </td>
        <td class="style2" colspan="2" rowspan="5" style="text-align:center" >

            <asp:Chart ID="Chart1" runat="server" Height="200px" Width="200px">
                <Titles>
                    <asp:Title Font="Calibri, 14pt, style=Bold" ForeColor="#666666" Name="Title1" 
                        Text="Total Call Status">
                    </asp:Title>
                </Titles>
                <series>
                    <asp:Series CustomProperties="DrawingStyle=Cylinder,
 MaxPixelPointWidth=50" IsValueShownAsLabel="True" Name="Series1" ShadowOffset="2">
                    </asp:Series>
                </series>
                <chartareas>
                    <asp:ChartArea BackGradientStyle="TopBottom" BackSecondaryColor="#B6D6EC" 
                        BorderDashStyle="Solid" BorderWidth="1" Name="ChartArea1">
                        <AxisX>
                            <MajorGrid Enabled="False" />
                        </AxisX>
                    </asp:ChartArea>
                </chartareas>
            </asp:Chart>



            </td>
        <td class="style2" rowspan="5" valign="top" style="text-align:center">

         <asp:Chart ID="ChtAgentCalls" runat="server" Height="200px" Width="200px">
         <Titles>

                              
                &LT;% -                           - %GT;
                                                                                                                                                                                     

        </td>
    </tr>
    <tr class="style4">
        <td class="style23">IVR</td>
        <td class="style20">
        <span style="vertical-align:middle" runat="server" id="spIVR"></span></td>
    </tr>
    <tr class="style4">
        <td class="style23">
        Agents</td>
        <td class="style20"><span ID="spAgentAtt" runat="server" style="vertical-align:middle"></span></td>
    </tr>
    <tr class="style4">
        <td class="style23">
            Abandoned</td>
        <td class="style20">
         <span style="vertical-align:middle" runat="server" id="spTAC"></span>
        </td>
    </tr>
    <tr class="style4">
        <td class="style23">
        Cancelled</td>
        <td class="style20"><span style="vertical-align:middle" runat="server" id="spCC"></span></td>
    </tr>
    <tr>
        <td class="style23">
        In Queue</td>
        <td class="style20"><span style="vertical-align:middle" runat="server" id="spCQ"></span></td>
        <td rowspan="4" style="text-align:center">
            <asp:Chart ID="ChtCalls" runat="server" Height="200px" Width="200px">
                <Titles>
                    <asp:Title Font="Calibri, 14pt, style=Bold" ForeColor="#666666" Name="Title1" 
                        Text="Abandoned Calls">
                    </asp:Title>
                </Titles>
                <series>
                    <asp:Series ChartType="Line" Color="Red" Name="Series1">
                    </asp:Series>
                </series>
                <chartareas>
                    <asp:ChartArea BackGradientStyle="TopBottom" BackSecondaryColor="#B6D6EC" 
                        BorderDashStyle="Solid" BorderWidth="1" Name="ChartArea1">
                        <AxisX>
                            <MajorGrid LineColor="#808080" />
                        </AxisX>
                        <AxisY>
                            <MajorGrid LineColor="#808080" />
                        </AxisY>
                    </asp:ChartArea>
                </chartareas>
            </asp:Chart>
        </td>
        <td colspan="2" rowspan="4" valign="top" style="text-align:center">
            <asp:Chart ID="ChtCampaign" runat="server" Height="200px" Width="200px">
                <Titles>
                    <asp:Title Font="Calibri, 14pt, style=Bold" ForeColor="#666666" 
                        Name="TotalCallsperCampaign" Text="Calls per Campaign">
                    </asp:Title>
                </Titles>
                <legends>
                    <asp:Legend Alignment="Center" Docking="Bottom" IsTextAutoFit="true" 
                        LegendStyle="Table" Name="Default"/>
                </legends>
                <series>
                    <asp:Series ChartType="Pie" CustomProperties="DrawingStyle=Pie, 
 PieDrawingStyle=Concave, MaxPixelPointWidth=50" IsValueShownAsLabel="True" Name="Series1" 
                        ShadowOffset="2">
                    </asp:Series>
                </series>
                <chartareas>
                    <asp:ChartArea Area3DStyle-Enable3D="true" BackGradientStyle="TopBottom" 
                        BackSecondaryColor="#B6D6EC" BorderDashStyle="Solid" BorderWidth="1" 
                        Name="ChartArea1">
                        <Area3DStyle Enable3D="True" />
                    </asp:ChartArea>
                </chartareas>
            </asp:Chart>
        </td>
    </tr>
    <tr class="style4">
        <td class="style23">
        Ghost Calls</td>
        <td class="style20"><span style="vertical-align:middle" runat="server" id="spGC"></span></td>
    </tr>
    <tr class="style4">
        <td class="style23">Outbound Calls</td>
        <td class="style20"><span style="vertical-align:middle" runat="server" id="spOutBC"></span></td>
    </tr>
    <tr class="style4">
        <td class="style23">
            Total Calls</td>
        <td class="style20"><span style="vertical-align:middle" runat="server" id="spTC"></span></td>
    </tr>

</table>  

用这个css

.style1
        {
            width: 100%;
            height:60%;
        }
无论我改变了什么高度。它没有改变。它保持不变。

我想扩大它。

请帮助

1 个答案:

答案 0 :(得分:1)

你需要给.style1一个容器。百分比高度需要父容器。然后它继承父母的固定值,&amp;可以滚动到父容器的60%。