javascript - table-layout: fixed css not working properly with given column's width -
here table structure
<table id="recordingstable" style="width:900px" class="tablesorter fixed_table"> </table>
css:
.fixed_table{ table-layout: fixed; }
populating table js:
str = '' str += '<thead>' str += '<tr>' + '<th style="width:150px;text-align:left !important;border-left:0;">col 1</th>' + '<th style="width:150px;text-align:center !important">col 2</th>' + '<th style="width:300px;text-align: center !important;">col 3</th>' + '<th style="width:100px;text-align: center !important;">col 4</th>' + '<th style="width:100px;text-align: center !important;">col 5</th>' + '<th style="width:100px;text-align: center !important;">col 6</th>' + '</tr>' + '</thead><tbody style="border-bottom: 1px solid #dddddd;">'; for(i=0; < recording_object.length; i++) { str += '<tr>'; str += '<td style="text-align:left !important; padding-left:8px;border-left:0;">' str += recording_object[i].text str += '</td>' str += '<td class="s3_file_path">' + recording_object[i].path + '</td>' str += '<td class="s3_file_name" style="font-size:11px;">' + recording_object[i].file_name + '</td>' str += '<td>' + recording_object[i].number + '</td>' str += '<td>'; str += '<button id="' + recording_object[i].id + '" onclick="dup_dialog(this)" type="button" data-toggle="modal" ' + 'data-target="#upload-all-modal" disabled="disabled" class="btn btn-primary btn-xs">duplicate</button>' + '</td>' str += "<td>"; str += '<button id="' + recording_object[i].id + '" class="btn btn-primary btn-xs" data-toggle="modal" ' + 'disabled="disabled" data-target="#association">association</button>' str += '</td></tr>' } str += '</tbody>'
but not showing table column's width defined in js, , when change column width doesn't change in view; when change inspecting element
it seems table-layout not working should assign each column width given. can help?
all see problem thead
.you forget open it.i put random data.i removed paddings in cells.the width specify in javascript.check fiddle.
Comments
Post a Comment