2012-01-05 1 views
1

J'ai une table sur ma page. Selon une sélection, je pourrais avoir 4 ou 5 lignes dans ma table. Je veux que ma taille de rangée supérieure soit exacte si j'ai 4 ou 5 rangées. Actuellement, il augmente la taille de ma rangée supérieure quand j'ai 4 lignes dans ma table. Des idées comment faire la rangée supérieure avec la même hauteur à chaque fois?Hauteur dynamique d'une ligne dans un tableau HTML

Voici ma table:

<table style="vertical-align:top; border-width:1px; border-style:solid; width:565px; height:155px; color:Black; font-size:8pt; left:19%; top:0px; position:absolute; border-color:Blue;">  
    <tr style="height:30px;">       
     <td align="left" style="width:190px; font-size:9pt; font-weight:bold; height:30px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@(Model.PlanSummary.Header)</td> 
     <td style="background-color:Red; width:130px; color:White; text-align:center; height:30px;">@(Model.PlanSummary.PlanTypes_1)</td> 
     <td align="center" style="background-color:Red; width:130px; color:White; height:30px; text-align:center; height:30px;">@(Model.PlanSummary.PlanTypes_2)</td> 
     <td align="center" style="background-color:Red; width:130px; color:White; height:30px; height:30px;">@(Model.PlanSummary.PlanTypes_3)</td> 
    </tr> 
    @{ 
     if(planName == "Business User") 
     { 
      <tr style="font-size:7pt;"> 
       <td align="left" style="width:190px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@(Model.PlanSummary.PlanUsersHeader) </td> 
       <td align="center" style="width:120px;"> @(Model.PlanSummary.PlanUsersDetail1) </td> 
       <td align="center" style="width:120px;"> @(Model.PlanSummary.PlanUsersDetail2) </td>    
       <td align="center" style="width:120px;"> @(Model.PlanSummary.PlanUsersDetail3) </td> 
      </tr> 
     }   
    } 
    <tr style="font-size:7pt;"> 
     <td align="left" style="width:190px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@(Model.PlanSummary.PlanPriceHeader)</td> 
     <td align="center"> @(Model.PlanSummary.PlanPriceDetail1) </td> 
     @{ 
      if(planName == "Business User") 
      { 
       <td align="center" style="width:120px; font-size: 9pt;"> 
        @Html.DropDownList("RPUserPricingList", (IEnumerable<SelectListItem>)Model.PlanSummary.UserPricingList, new { style = "font-family: Verdana; font-size: 6pt; text-align:center; width:100px;" })      
       </td> 
       <td align="center" style="width:120px; font-size: 9pt;"> 
        @Html.DropDownList("RPCompanyPricingList", (IEnumerable<SelectListItem>)Model.PlanSummary.ComanyPricingList, new { style = "font-family: Verdana; font-size: 6pt; text-align:center; width:90px;" })      
       </td> 
      } 
      else 
      { 
       <td align="center"> @(Model.PlanSummary.PlanPriceDetail2) </td>  
       <td align="center"> @(Model.PlanSummary.PlanPriceDetail3) </td> 
      } 
     }     
    </tr> 
    <tr style="font-size:7pt;"> 
     <td align="left" style="width:190px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@(Model.PlanSummary.PlanUnitCountHeader)</td> 
     <td align="center"> @(Model.PlanSummary.PlanUnitCountDetail1) </td> 
     <td align="center"> @(Model.PlanSummary.PlanUnitCountDetail2) </td> 
     <td align="center"> @(Model.PlanSummary.PlanUnitCountDetail3) </td> 
    </tr>  
    <tr> 
     <td></td> 
     @{ 
      if(planName == "Personal") 
      { 
        <td align="center"><button style="background-image:url('Content/Images/ShortRedButton.png');color:White;width:86px;height:24px;font-size:6pt;">@(Model.PlanSummary.Btn1)</button></td> 
        <td align="center"><button style="background-image:url('Content/Images/ShortRedButton.png');color:White;width:86px;height:24px;font-size:6pt;">@(Model.PlanSummary.Btn2)</button></td> 
        <td align="center"><button style="background-image:url('Content/Images/ShortRedButton.png');color:White;width:86px;height:24px;font-size:6pt;">@(Model.PlanSummary.Btn3)</button></td> 
      } 
      else 
      { 
       <td align="center"><button style="background-image:url('Content/Images/ShortRedButton.png');color:White;width:86px;height:24px;font-size:6pt;">@(Model.PlanSummary.Btn1)</button></td> 
       <td align="center"><button style="background-image:url('Content/Images/ShortRedButton.png');color:White;width:86px;height:24px;font-size:6pt;">@(Model.PlanSummary.Btn2)</button></td> 
       <td align="center"> 
        <button style="background-image:url('Content/Images/LongRedButton.png');color:White;width:96px;height:26px;font-size:6pt;">@(Model.PlanSummary.Btn3)</button>        
        <br /> 
        <button style="background-image:url('Content/Images/LongRedButton.png');color:White;width:96px;height:26px;font-size:6pt;">@(Model.PlanSummary.Btn4)</button> 
       </td> 
      }    
     }   
    </tr> 
</table> 
+0

J'ai retiré l'élément de hauteur de la table def. et ça a marché. –

+1

Ajoutez cela comme réponse et acceptez-le. Ce n'est pas seulement OK pour répondre à vos propres questions, c'est encouragé. Une réponse est plus facile à voir qu'un commentaire. De plus, cela le marquera comme résolu afin qu'il n'apparaisse pas dans les listes "sans réponse". – ThinkingStiff

+1

Fera. Merci!!!! –

Répondre

0

J'ai enlevé l'élément de la hauteur de la table et cela a fonctionné pour moi. Merci!

Questions connexes