hi have created jquery datatables looks this:
so question how remove padding in "picture" column?
this how initialize table:
$('#violators_tbl').datatable({ "aocolumndefs": [ { "bsortable": false, "atargets": [ 2,3 ] }, { "swidth": "20%", "atargets": [ 0 ] }, { "swidth": "35%", "atargets": [ 1 ] }, { "swidth": "30%", "atargets": [ 2 ] }, { "swidth": "15%", "atargets": [ 3 ] }, ], });
this how add rows table:
function update_table(violator){ var img_str1 = '<img class=\"obj-pic\" src=\"' + main.vars.base_path + violator.front_temp_file_path + '\">'; var img_str2 = '<img style=\"margin-left: 10px;\" class=\"obj-pic\" src=\"' + main.vars.base_path + violator.rear_temp_file_path + '\">'; var img_str3 = '<img style=\"margin-left: 10px;\" class=\"obj-pic\" src=\"' + main.vars.base_path + violator.right_temp_file_path + '\">'; var img_str4 = '<img style=\"margin-left: 10px;\" class=\"obj-pic\" src=\"' + main.vars.base_path + violator.left_temp_file_path + '\">'; violators_table.datatable().fnadddata([ violator.violator_id, violator.get_full_name(), 'under construction', img_str1 + img_str2 + img_str3 + img_str4, ]); }
easier way add sclass
option adds class designated columns. thereafter, can style my_class
according needs. way, specific table instance affected , not others in application.
$('#violators_tbl').datatable({ "aocolumndefs": [ { "sclass": "my_class", "atargets": [ 0 ] } ] } );