根据某些条件将表中的某些列显示为灰色
我有一个 .jsp 页面,显示包含 4 列的付款表。根据登录用户的类型,我想将不可用的选项灰显。如果某人是完整订阅者,则他们只能按使用量付费,并将其余部分灰显(例如)。如果是基本型,则 1、3、4 列将可用,2 列呈灰色。我知道我可以通过检查 ${subs.costs}" 的长度来确定应该显示哪些选项"
我可以仅使用 jquery、css 来完成此操作吗?根据上面的参数,它的代码是什么?
我的 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>
I have a .jsp page that displays a payment table with 4 columns. 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. I know I can identify what options should be displayed by checking the length of ${subs.costs}"
Can I do this with just jquery, css and what is the code for it based on the parameter above?
My html is:
<!-- 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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您需要知道视图中可能不可用的订阅者属性,因此您最好在服务器上设置 css 而不是使用 jquery ...
Since you need to know attributes of the subscriber that may not be available in the view, you are probably better setting the css on the server rather than with jquery ...