html - Need to span my <td> across several rows, not working, using Razor syntax -


here's code (look says rowspan="6" - not working:

<table>                 <thead>                     <tr>                         <td>ingredient</td>                         <td>qty (gm)</td>                         <td>% of capsule</td>                     </tr>                 </thead>                 @foreach (var in model)                 {                     if (convert.todecimal(i.qty) < 0)                     {                         <tr>                             <td style="border: 1px solid red; color: red;">@i.ingredient</td>                             <td style="border: 1px solid red; color: red;">@i.qty</td>                         </tr>                     }                      else if (convert.todecimal(i.qty) == 0m)                     {                         continue;                     }                      else                     {                         if (i.ingredient.contains("active"))                         {                         <tr>                             <td>@i.ingredient<br />                                 <input type="text" name="@i.ingredient" id="@i.ingredient" /></td>                             <td>@i.qty</td>                             @if (i.percent != 0m)                             {                                 <td rowspan="6" style="text-align: center;">@i.percent.tostring("#.##")</td>                             }                         </tr>                         }                         else                         {                         <tr>                             <td>@i.ingredient</td>                             <td>@i.qty</td>                             @if (i.percent != 0m)                             {                                 <td style="text-align: center;">@i.percent.tostring("#.##")</td>                             }                             else                             {                                 <td></td>                             }                         </tr>                         }                     }                 }                 <tr>                     <td></td>                     <td>total %:</td>                     <td style="text-align: center;">@model.sum(j => j.percent).tostring("#.##")</td>                 </tr>             </table> 

which produces:

enter image description here

i need align cell contains 9.74 center of 6 rows, indicated in screenshot red arrows. doing wrong?

the rowspan working fine. value needs vertically aligned,

<td rowspan="6" style="vertical-align:center; text-align:center;"> 

let me know if helps.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -