You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何实现点击HTML表格指定单元格后显示第二个隐藏表格的功能

HTML中的隐藏元素

我想要实现与下述示例完全一致的效果:
当用户点击783时
点击前页面效果
会显示第二个HTML表格
点击后展示表格效果

以下是我当前使用的表格代码,我希望当点击32或者其他灰色背景的数值时,能够展示一个包含两列的HTML表格。
当前使用的表格样式

<table class="table table-striped" style="width:100%; text-align: center;">
   <thead>
      <tr>
         <th scope="col" style="width: 4%; ">LABEL </th>
         <th scope="col" style="width: 9%; ">LABEL </th>
         <th scope="col" style="width: 9%; ">LABEL </th>
         <th scope="col" style="width: 5%; ">LABEL </th>
         <th scope="col" style="width: 10%; ">LABEL </th>
         <th scope="col" style="width: 14%; background-color: #dee2e657; ">LABEL </th>
         <th scope="col" style="width: 10%;">LABEL </th>
         <th scope="col" style="width: 5%; ">LABEL </th>
         <th scope="col" style="width: 9%;">LABEL </th>
         <th scope="col" style="width: 9%; ">LABEL </th>
      </tr>
   </thead>
   <tr>
      <td scope="col" style="width: 4%; ">10</td>
      <td scope="col" style="width: 9%; ">30</td>
      <td scope="col" style="width: 9%; ">58</td>
      <td scope="col" style="width: 5%; ">11</td>
      <td scope="col" style="width: 10%; ">17</td>
      <td scope="col" style="width: 12%; background-color: #dee2e657;">32</td>
      <td scope="col" style="width: 10%; ">44</td>
      <td scope="col" style="width: 5%; ">20</td>
      <td scope="col" style="width: 9%; ">10</td>
      <td scope="col" style="width: 9%; ">11</td>
   </tr>
   <tr>
      <td scope="col" style="width: 4%; ">20</td>
      <td scope="col" style="width: 9%; ">40</td>
      <td scope="col" style="width: 9%; ">18</td>
      <td scope="col" style="width: 5%; ">31</td>
      <td scope="col" style="width: 10%; ">27</td>
      <td scope="col" style="width: 12%; background-color: #dee2e657;">47</td>
      <td scope="col" style="width: 10%; ">25</td>
      <td scope="col" style="width: 5%; ">21</td>
      <td scope="col" style="width: 9%; ">90</td>
      <td scope="col" style="width: 9%; ">51</td>
   </tr>
</table>

内容的提问来源于stack exchange,提问作者almokhadi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.30 05:54:01