Rowspan with Bootstrap-table-fixed-columns extension

ⅰ亾dé卋堺 提交于 2019-12-10 11:54:48

问题


I have a problem with the fixed-columns extension of Bootstrap-Table. I'm trying to use a rowspan attribute to have a "3-rows-high" fixed column on the left, followed by a fixed column of 3 rows, but it seems that it doesn't work :

https://jsfiddle.net/Lx87aetc/4/

The goal is to do something with the following architecture :

<table>
  <thead>
    <tr>
      <th></th>
      ...
    </tr>
  </thead>
  <tbody>
    <tr>
      <td rowspan="3"></td>
      ...
    </tr>
    <tr>...</tr>
    <tr>...</tr>
  </tbody>
</table>

Does anyone have an idea to solve my problem ?

Thank you, Ed


回答1:


The solution simply didn't exist, it was a bug, split into 2 bugs :

Firstly, Bootstrap-Table didn't handle correctly the rowspan / colspan management (some '-' are appended at the end of the rows). Wenzhixin has corrected this: https://github.com/wenzhixin/bootstrap-table/commit/468169cde5bdbf2178a9299d288622fe93777aaa

Secondly, the fixed-column extension didn't handly correctly this either, which lead to a "double" bug (some '-' + buggy fixed columns): I corrected the extension bug : https://github.com/wenzhixin/bootstrap-table-fixed-columns/pull/12

Now it's working : https://jsfiddle.net/wenyi/3v7h5erL/3/

It's solving simple situations like this one :

<table data-toggle="table" data-fixed-columns="true" data-fixed-number="3">
  <thead>
    <tr>
      <th>Title</th>
      <th>1</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td rowspan="2">Momentum</td>
      <td>1</td>
      <td>2</td>
    </tr>
    <tr>
      <td>1</td>
      <td>2</td>
    </tr>
    <tr>
      <td>1</td>
      <td>2</td>
    </tr>
  </tbody>
</table>


来源:https://stackoverflow.com/questions/35473014/rowspan-with-bootstrap-table-fixed-columns-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!