Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

230
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda