数据表:是否可以使用Ajax填充2列并对其他列使用不同的方式?

I have a table with send mail info, I use Smarty, a PHP engine, to fill this table.

I want to add 2 other columns with open and click ratios (of the mailings). I use an API to get this information in PHP, but because the API is slow I first want to load the normal columns and then when it's loaded I want to load the other 2 columns, is this possible in any way?

Basically, Can I fill a data table with 5 columns and when that's done add 2 more with ajax?

Right now I use 1 ajax call to get everything.

This is definitely something you can do. I have had a lot of success using the columns option in creating and populating my table. I use a buildTable function where I pass the results of an AJAX call, the variable here is called dataList, and use the object to build the table as follows. In this example the value for data is the name of the field in the dataList variable whose value I would like to appear in the table. In your case I would expect dataList to be the results from your database.

Note that both the title and data fields can take functions or html as input so you could either make an AJAX call in this field, or input a placeholder div to append the results to later using JQuery or whatever you liked.

$("#table-main").DataTable({
        //options
        columns: [
            {
                data: "data1",
                title: "columnName"
            },
            {
                data: "data2",
                title: "columnName"

            },
            {
                data: "data3",
                title: "columnName"
            },
            {
                data: "<div id='ajax_result_holder'></div>",
                title: "columnName"
            },
            {
                data: function(row, type, set){
                      //make AJAX call, return result
                },
                title: "columnName"
            },
        ],
        data: dataList
});