Browse Source

[Bugfix] table keeps getting bigger

if <th> have padding。The table keeps getting bigger。
reatang 6 years ago
parent
commit
836c981fe5
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/bootstrap-table.js

+ 4 - 4
src/bootstrap-table.js

@@ -1763,7 +1763,7 @@ class BootstrapTable {
       if (this.options.detailView && this.options.detailViewIcon && !this.options.cardView) {
       if (this.options.detailView && this.options.detailViewIcon && !this.options.cardView) {
         if (i === 0) {
         if (i === 0) {
           const $thDetail = $ths.filter('.detail')
           const $thDetail = $ths.filter('.detail')
-          const zoomWidth = $thDetail.width() - $thDetail.find('.fht-cell').width()
+          const zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width()
           $thDetail.find('.fht-cell').width($this.innerWidth() - zoomWidth)
           $thDetail.find('.fht-cell').width($this.innerWidth() - zoomWidth)
         }
         }
         index = i - 1
         index = i - 1
@@ -1778,7 +1778,7 @@ class BootstrapTable {
         $th = $($ths[$this[0].cellIndex])
         $th = $($ths[$this[0].cellIndex])
       }
       }
 
 
-      const zoomWidth = $th.width() - $th.find('.fht-cell').width()
+      const zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width()
       $th.find('.fht-cell').width($this.innerWidth() - zoomWidth)
       $th.find('.fht-cell').width($this.innerWidth() - zoomWidth)
     })
     })
 
 
@@ -1877,7 +1877,7 @@ class BootstrapTable {
       if (this.options.detailView && !this.options.cardView) {
       if (this.options.detailView && !this.options.cardView) {
         if (i === 0) {
         if (i === 0) {
           const $thDetail = $ths.filter('.detail')
           const $thDetail = $ths.filter('.detail')
-          const zoomWidth = $thDetail.width() - $thDetail.find('.fht-cell').width()
+          const zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width()
           $thDetail.find('.fht-cell').width($this.innerWidth() - zoomWidth)
           $thDetail.find('.fht-cell').width($this.innerWidth() - zoomWidth)
         }
         }
         index = i - 1
         index = i - 1
@@ -1888,7 +1888,7 @@ class BootstrapTable {
       }
       }
 
 
       const $th = $ths.eq(i)
       const $th = $ths.eq(i)
-      const zoomWidth = $th.width() - $th.find('.fht-cell').width()
+      const zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width()
       $th.find('.fht-cell').width($this.innerWidth() - zoomWidth)
       $th.find('.fht-cell').width($this.innerWidth() - zoomWidth)
     })
     })