Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

233
Vistas
How to add Json data for Header and body for bootstrapTable using javascript

I am using latest bootstrap-Table for Table with Dynamic data from JSON url. I tried with static header and TD fields (jsfiddle-1) from JSON from bootstrap-Table also I used data-field option in th (jsfiddle-2) but What I am looking is Dynamic Header and Dynamic TD from URL using foreach. I checked with bootstrap-Table samples but not available. Please share the samples and ideas.

Fiddle 1 :

$(function() {

$('#table').bootstrapTable({
    url: 'https://examples.wenzhixin.net.cn/examples/bootstrap_table/data',
    pagination: true,
    height: 450,
    locale: 'en-US',
    pageList: [30,55,80,100],
    pageSize: 30,
    columns: [
      [ {
        title: 'Site ID',
        field: 'id',          
        align: 'center',
        valign: 'middle',
        sortable: true,
        
      } ,
      {
        field: 'name',
        title: 'Customer Name',
        sortable: true,
        
        align: 'center'
      }, {
        field: 'price',
        title: 'Depot',
        sortable: true,
        align: 'center',
      
      } ]
    ] 
    

}); });

Fiddle 2:

$(function() {

$('#table').bootstrapTable({
    url: 'https://examples.wenzhixin.net.cn/examples/bootstrap_table/data',
    pagination: true,
    height: 450,
    locale: 'en-US',
    pageList: [30,55,80,100],
    pageSize: 30 

}); });

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

if you want to have dynamic header and maybe footer too, you can also try php for this situation.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda