2012-07-10 55 views
0

我必须隐藏桌子上的一列,并在悬停时再次显示。这是表的外观:如何隐藏mvc3中的表格列并显示悬停?

 ProjectName|Description|Status 

我不得不隐藏描述表,并显示在一个弹出时,我把鼠标放在项目名。说明栏应在开始时处于隐藏模式。

这是我Index.cshtml网页使用jQuery的外观

   @{ 
      ViewBag.Title = "Index"; 
      } 

     <h2>Index</h2> 

     <p> 
     @Html.ActionLink("Create New", "Create") 
     </p> 
     <table> 
      <tr> 
       <th> 
       projectName 
     </th> 
     <th> 
      Description 
     </th> 
     <th> 
      status 
     </th> 
     <th></th> 
    </tr> 

    @foreach (var item in Model) { 
     <tr> 
     <td> 
      @Html.DisplayFor(modelItem => item.projectName) 
     </td> 
     <td > 
      @Html.DisplayFor(modelItem => item.Description) 
     </td> 
     <td> 
      @Html.DisplayFor(modelItem => item.status) 
     </td> 
     <td> 
     @Html.ActionLink("Edit", "Edit", new { id=item.ProjectId }) | 
     @Html.ActionLink("Details", "Details", new { id=item.ProjectId }) | 
     @Html.ActionLink("Delete", "Delete", new { id=item.ProjectId }) 
     </td> 
     </tr> 
     } 

</table> 

回答