Row width

Row width

jmorrisonjmorrison Posts: 4Questions: 0Answers: 0
edited February 2013 in General
Hi all,

When i render my datatable my rows to not fill the entire table body. There is always a 2-3 pixel gap to the right of the row including the header. I can see this whenever I underline a row or give it a back color and cannot for the life of me figure out what is causing it. Has anyone else experienced this problem and perhaps come up with a solution?

Below is the code I use to instantiate the table.

[code]
function CreateMessageTable(f) {
oTable = $('#messageTable').dataTable({
"bServerSide": true,
"sAjaxSource": f,
"bAutoWidth":false,
"oLanguage": { "sEmptyTable": "No messages found" },
"bProcessing": true,
"bLengthChange": false,
"bScrollInfinite": true,
"bProcessing": true,
"sScrollY": "275px",
"fnDrawCallback": function (oSettings){
for (var i = 0, il = oSettings.aoData.length; i < il; i++) {
if (oSettings.aoData[i]._aData[5] == "False") {
oSettings.aoData[i].nTr.className = " message_unread";
} else {
oSettings.aoData[i].nTr.className = " message_read";
}
}
},
"fnInitComplete": function (oSettings) {
for (var i = 0, il = oSettings.aoData.length; i < il; i++) {
if (oSettings.aoData[i]._aData[5] == "False") {
oSettings.aoData[i].nTr.className = " message_unread";
} else {
oSettings.aoData[i].nTr.className = " message_read";
}
}
},
"aoColumns": [
{ "sName": "Subject",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
if (oObj.aData[5] == "True") {
return "" + oObj.aData[0] + "";
} else {
return "" + oObj.aData[0] + "";
}
}
},
{ "sName": "Message Type",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
if (oObj.aData[5] == "True") {
return "" + oObj.aData[1] + "";
} else {
return "" + oObj.aData[1] + "";
}
}
},
{ "sName": "Date", "sType": "date",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
if (oObj.aData[5] == "True") {
return "" + oObj.aData[2] + "";
} else {
return "" + oObj.aData[2] + "";
}
}
}

]
});
}
[/code]

Edit: Thought this html might also be important

[code]








All Messages





Subject



Filing



Date








[/code]

Thanks in advance for any help,
JMorrison

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Can you link to a live test case showing the issue please? I can't say when it wrong with it rom the code above.

    Allan
  • jmorrisonjmorrison Posts: 4Questions: 0Answers: 0
    Hi Allan and thank you for your response. I am unable to post a live test case at this time (what would you suggest is the best way to do this so I know in the future?) but have attached an image that describes the problem.

    http://tinypic.com/r/2hhqcm0/6

    It seems that the width of the is generated at 697 px and the sum of the three s only sum to 693px. As you can see above all widths are set with percentages. If this is still not enough please let me know so I can try to give you more information. I would love to know how/why this is happening.

    Many thanks,
    JMorrison
This discussion has been closed.