Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!