Error with bootstrap-table

0

I try to give the Bootstrap-table style to a table, but I mark the following error and I do not know why, if in other tables it works:

Uncaught TypeError: Cannot read property 'field' of undefined
    at HTMLTableCellElement.<anonymous>

// add BootstrapTable

$("#datosTable").bootstrapTable({
       pagination: true,
       showFooter: true,
       search: true,
       showExport:true,
       filter: true,
       method: 'post',
       showRefresh:true,
       pageList:[10, 25, 50, 100, 'All'],
       showPaginationSwitch: true
});

"The data in the table is already loaded, it's just styling, paging and the properties that show me"

  

This is the HTML of my table "obviously has more data this is only for   an idea "

<table id="datosTable" class="table table-striper table-bordered table-hover">
   <thead>
      <tr>
         <td colspan="2">Lugar</td>
         <td colspan="2">CHIN</td>
         <td colspan="2">EUA</td>
         <td colspan="2">MEX</td>

      </tr>
      <tr>
         <td>Nombre</td>
         <td>Nº</td>
         <td>Peso.</td>
         <td>%</td>
         <td>Peso.</td>
         <td>%</td><td>Peso.</td>
         <td>%</td>

      </tr>
   </thead>
   <tbody>
      <tr>
         <td>Acero </td>
         <td>43a</td>
         <td>0.47</td>
         <td>6800</td>
         <td>0</td>
         <td>0</td>
         <td>0</td>
         <td>0</td>

      </tr>
      </tbody>
</table>
    
asked by Soldier 22.08.2017 в 00:57
source

1 answer

1

I read a part of the Bootstrap Table documentation here.

I guess the error falls on the TD you have over the THEAD . In the documentation it is shown (and in fact in all the examples that there are) that all the cells that are inside THEAD must go with the label TH .

Then, try to change your TD tags within your THEAD by TH tags.

    
answered by 22.08.2017 / 18:22
source