在用Virtualize组件呈现的表中使用rowspan标签

发布于 2025-02-13 09:42:41 字数 975 浏览 0 评论 0原文

我正在努力在使用组件呈现的表中设置rowspan。看来,对于每个渲染视图,我都需要构建一个自定义的表脚手架才能获得适当的rowspan。

  <table>
    <thead>...</thead>
    <tbody>
      <Virtualize Items="@Models" Context="model">
        <tr>
           <th rowspan="??">label of several rows<th>
           <td>model data in cell</td>
           <td>model data in cell</td>
           ...
           <td>model data in cell</td>
        </tr>
      </Virtualize>
    </tbody>
    <tfoot>...</tfoot>
    </table>

在哪里 ”??”是一个非恒定值。

我看到的唯一解决方案是获取组件中列表的当前渲染部分。有没有办法获取此类数据?

看看 fiddle 。如果虚拟化组件仅在2到7之间呈现,则表留在第一行rowspan标签的情况下,它像 fiddle

Im struggling with setting a rowspan in a table rendered using component. It seems that for every rendered view I need to build a custom table scaffolding in order to get proper rowspan.

  <table>
    <thead>...</thead>
    <tbody>
      <Virtualize Items="@Models" Context="model">
        <tr>
           <th rowspan="??">label of several rows<th>
           <td>model data in cell</td>
           <td>model data in cell</td>
           ...
           <td>model data in cell</td>
        </tr>
      </Virtualize>
    </tbody>
    <tfoot>...</tfoot>
    </table>

Where "??" is a non-constant value.

The only solution I see is to get the currently rendered part of the list in the component. Is there a way to get such data?

Take a look at the Fiddle. If the Virtualize component renders only rows between 2 and 7, the table is left without the first row rowspan tag and hance it is broken like in this Fiddle.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文