Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6323681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:33:54+00:00 2026-05-24T16:33:54+00:00

<table cellpadding=0 cellspacing=0 border=1 class=display id=FormsData style=margin-bottom:5px;> <thead> <tr id=thFormsData> </tr> <tr> </tr> </thead>

  • 0
<table cellpadding="0" cellspacing="0" border="1" class="display" id="FormsData" style="margin-bottom:5px;">
    <thead>
        <tr id="thFormsData"> 

        </tr>
        <tr>
        </tr> 
    </thead>
    <tbody>
        <tr>
            <td class="dataTables_empty">
                Loading data ...
            </td>
        </tr>
    </tbody>          
</table>

Above is the table structure for jQuery datatable. and I am using below code to fill it.

$(document).ready(function() { 
   $('#FormsData').dataTable({
        "sDom": 'T<"clear">lfrtip',
        "bProcessing": true,
        "bServerSide": true,
        "sAjaxSource": "GetJsonData.aspx?FormKey=" + getQuerystring("FormKey", "") + "&FormData=Get"
  )}
)}

Now problem is that in this way I have to define th in table structure which jQuery datable is using as columns. But in my case I want to append th dynamically to the table before it initialize.

I want to append th based on json data which I get from GetJsonData.aspx file. Its defined in “sAjaxSource”: “GetJsonData.aspx …”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:33:55+00:00Added an answer on May 24, 2026 at 4:33 pm

    There is a good example of loading dynamically from an JS array http://www.datatables.net/examples/data_sources/js_array.html

    Here you need only to replace the static data with the data returned from the webservice.

    var url = "GetJsonData.aspx?FormKey=" + getQuerystring("FormKey", "") + "&FormData=Get";
    
    $.getJSON(url, function(data) {
        //test response and manipulate structure if necissary
    
        $('#example').dataTable( {
            "aaData":data,
            "aoColumns": [
                { "sTitle": "Engine" },
                { "sTitle": "Browser" } // etc...
            ]
        });
    });
    

    The aoColumns will also allow you to dynamically render the columns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CSS table tr {border-bottom:1px solid #008999} HTML <table width=100% cellspacing=0 cellpadding=0> <thead> <tr> <th
So far, I'm doing this programmatically using VB.net/ASP.net: <table cellspacing=0 cellpadding=4 border=0 style=border- width:0px;width:100%;border-collapse:collapse;font-size:12px;>
I have several forms like this: <table width=100% border=0 cellpadding=0 cellspacing=0 class=table_std> <tr id=exam_String_newValue_row>
Take a look at this table: <table cellpadding=0 cellspacing=0 class=order_form> <tr> <th>Amount</th> <th>Desc</th> <th>Price</th>
This is my markup: <table class=col1table cellspacing=0 cellpadding=0> <tr> <td><a class=tips_trigger href=#><img src=/img/design/icon_tips_venn.png /></a></td>
Here's my HTML Table format : <table width=580 height=217 border=0 cellpadding=0 cellspacing=0> <tr> <td
I have the following code <table cellpadding=2 cellspacing=2> <tr> <td>Factory:</td> <td> <asp:TextBox ID=txtFactory runat=server
<table cellspacing=0 cellpadding=0> <textarea rows=5 cols=60 name=question></textarea> <tr> <td><input type=text readonly=1 value=127.0.0.1 /></td> <td><input
<h:dataTable cellpadding=0 cellspacing=0 styleClass=list_table id=OuterItems value=#{valueList.values} var=item border=0> <h:column rendered=#{item.typeA}> <h:dataTable cellpadding=0 cellspacing=0 styleClass=list_table
I have a table with a code like this: <table cellpadding=6 rules=groups frame=no> <thead>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.