简体   繁体   English

根据特定条件将表格中的某些列灰显

[英]Grey out certain columns from my table based on certain conditions

I have a .jsp page that displays a payment table with 4 columns. 我有一个.jsp页面,其中显示具有4列的付款表。 Based on the type of user signed in, I want to grey out the non-available options. 根据登录用户的类型,我希望将不可用的选项显示为灰色。 If someone is a full subscriber will have only pay as you go available to them and grey out the rest as an example. 如果某人是全额订户,那么您将仅在您有空时向他们付费,而其余的则以灰色显示为例。 If is on a basic, will 1, 3, 4 column will be available and 2 grey out. 如果是在基础上,将有1、3、4列可用,而2列为灰色。 I know I can identify what options should be displayed by checking the length of ${subs.costs}" 我知道我可以通过检查$ {subs.costs}的长度来确定应显示哪些选项”

Can I do this with just jquery, css and what is the code for it based on the parameter above? 我可以仅使用jquery,css来执行此操作吗,根据上述参数,它的代码是什么?

My html is: 我的html是:

        <!-- TBODY -->
        <tbody>
          <tr>
            <td></td>
            <th> pay as you go</th>
            <th> Basic subscription</th>
            <th> Advanced subscription</th>
            <th> Full Subscription</th>
          </tr>
          <tr>
            <td></td>
            <td>price</td>
            <td>price</td>
            <td>price</td>
            <td>price</td>
         </tr>           
  </tbody> 
  </table> 

由于您需要了解视图中可能不可用的订户属性,因此最好在服务器上设置css,而不要使用jquery ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM