Fix table heather align

Fix table heather align

dcd4u2dcd4u2 Posts: 5Questions: 0Answers: 0
edited October 2011 in General
Hi,

I have a problem with DT. I need to align column heather in other way than other cells. In the image you can see my problem. In column "NAME" I need to center heather, in other cells of that column align must be "left".

http://www.image-share.com/ijpg-1004-235.html

If you can, please help.

[code]
$(document).ready(function() {
...
oTable_6_167 = $('#table_6_167').dataTable( {
"bProcessing": false,
"sAjaxSource": 'modules.php?name=Logos_6&opt=table_6_167&reg='+base64_encode(a2s(registos)),
"bServerSide": false,
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": true,
"bInfo": false,
"aoColumns": [
{ "mDataProp": "vendas_facturas_linhas[sdo]", "aTargets": [ 0 ] },
{ "mDataProp": "vendas_facturas_linhas[linha]", "aTargets": [ 1 ] },
{ "mDataProp": "vendas_facturas_linhas[factura]", "aTargets": [ 2 ] },
{ "mDataProp": "vendas_facturas_linhas[mercadoria]",
"aTargets": [ 3 ],
"sClass": "align2",
"fnRender": function ( oObj ) {
return BIGINTMask('', 'nnnnnnnnnnnnn', oObj.aData["vendas_facturas_linhas[mercadoria]"]);
},
"bUseRendered": false
},
{ "mDataProp": "vendas_facturas_linhas[designacao]",
"aTargets": [ 4 ],
"sClass": "align0",
"fnRender": function ( oObj ) {
return VARCHARMask('', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', oObj.aData["vendas_facturas_linhas[designacao]"]);
},
"bUseRendered": false
},
{ "mDataProp": "vendas_facturas_linhas[quantidade]",
"aTargets": [ 5 ],
"sClass": "align2",
"fnRender": function ( oObj ) {
return DECIMALMask('', '-nnn,nnN.nnn', oObj.aData["vendas_facturas_linhas[quantidade]"]);
},
"bUseRendered": false
},
{ "mDataProp": "mercadorias_unidades_venda[designacao_abrev]",
"aTargets": [ 6 ],
"sClass": "align0",
"sWidth": "1px",
"fnRender": function ( oObj ) {
return VARCHARMask('', 'xxxxx', oObj.aData["mercadorias_unidades_venda[designacao_abrev]"]);
},
"bUseRendered": false
},
{ "mDataProp": "vendas_facturas_linhas[preco_venda]",
"aTargets": [ 7 ],
"sClass": "align2",
"fnRender": function ( oObj ) {
return DECIMALMask('', 'nn,nnn,nnN.NNn €', oObj.aData["vendas_facturas_linhas[preco_venda]"]);
},
"bUseRendered": false
},
{ "mDataProp": "vendas_facturas_linhas[taxa_desconto_comercial]",
"aTargets": [ 8 ],
"sClass": "align1",
"fnRender": function ( oObj ) {
return DECIMALMask('', 'nnN.nn%', oObj.aData["vendas_facturas_linhas[taxa_desconto_comercial]"]);
},
"bUseRendered": false
},
{ "mDataProp": "vendas_facturas_linhas[tipo_iva_venda]", "aTargets": [ 9 ] },
{ "mDataProp": "vendas_facturas_linhas[taxa_iva]",
"aTargets": [ 10 ],
"sClass": "align1",
"fnRender": function ( oObj ) {
return DECIMALMask('', 'nN.nn%', oObj.aData["vendas_facturas_linhas[taxa_iva]"]);
},
"bUseRendered": false
},
{ "mDataProp": "vendas_facturas_linhas[total_iva]",
"aTargets": [ 11 ],
"sClass": "align2",
"fnRender": function ( oObj ) {
return DECIMALMask('', 'n,nnn,nnn,nnN.NN €', oObj.aData["vendas_facturas_linhas[total_iva]"]);
},
"bUseRendered": false
},
{ "mDataProp": "vendas_facturas_linhas[total_bruto]",
"aTargets": [ 12 ],
"sClass": "align2",
"fnRender": function ( oObj ) {
return DECIMALMask('', 'n,nnn,nnn,nnN.NN €', oObj.aData["vendas_facturas_linhas[total_bruto]"]);
},
"bUseRendered": false
},
{ "mDataProp": null,
"sClass": "align1",
"sWidth": "1px",
"aTargets": [ 13 ],
"fnRender": function ( oObj ) {
oObj.aData[13]='';
return oObj.aData[13];
},
"bUseRendered": false
}
],
"aoColumnDefs": [
{ "bSortable": false, "bSearchable": false, "bVisible": false, "aTargets": [ 0 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": false, "aTargets": [ 1 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": false, "aTargets": [ 2 ] },
{ "bSortable": true, "bSearchable": false, "bVisible": true, "aTargets": [ 3 ] },
{ "bSortable": true, "bSearchable": false, "bVisible": true, "aTargets": [ 4 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": true, "aTargets": [ 5 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": true, "aTargets": [ 6 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": true, "aTargets": [ 7 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": true, "aTargets": [ 8 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": false, "aTargets": [ 9 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": true, "aTargets": [ 10 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": true, "aTargets": [ 11 ] },
{ "bSortable": true, "bSearchable": false, "bVisible": true, "aTargets": [ 12 ] },
{ "bSortable": false, "bSearchable": false, "bVisible": true, "aTargets": [ 13 ] }
],
} );
} );

...







CODE
NAME
#
UNI
PRICE
DISCOUNT

VAT %
VAT €
TOTAL







...

.align0 {
text-align: left;
white-space: nowrap;
}
.align1 {
text-align: center;
white-space: nowrap;
}
.align2 {
text-align: right;
white-space: nowrap;
}

[/code]

....
This discussion has been closed.