Individual Column Alignment

Individual Column Alignment

DarkenspiritDarkenspirit Posts: 48Questions: 11Answers: 0

Searching forums produced questions from 2009 and the syntax seemed incredibly wrong and/or different.

From what I gathered though, it seems like I need to define something like an sdata inside my columns during initialisation and then use CSS to style them?

$(document).ready(function() {
    var table = $('#table_1').dataTable( {
        "ajax": {
            "url": "http://localhost:8081/",
            "dataSrc": ""
        },
        "columns": [
            { "data": "policyid"},
            { "data": "policytxnid" },
            { "data": "pol submission no" },
            { "data": "txn submission no" },
            { "data": "nfpusertype" },
            { "data": "policystatuscode" },
            { "data": "statecode" },
            { "data": "insurancecompanyname" },
            { "data": "transactiontypecd" },
            { "data": "new renewal?" },
            { "data": "SIC Code" },
            { "data": "SIC Description" },
            { "data": "createddate"},
            { "data": "epcyn" },
            { "data": "dnoyn" },
            { "data": "fidyn" },
            { "data": "crmyn" }
        ],
        "dom": 'TC<"clear">lfrtipS',
        "tableTools": {
            "sRowSelect": "multi",
            "aButtons": [
                {
                    "sExtends": "copy",
                    "bSelectedOnly": true,
                    "mColumns": "visible"
                },
                {
                    "sExtends": "csv",
                    "bSelectedOnly": true,
                    "mColumns": "visible"
                },
                {
                    "sExtends": "xls",
                    "bSelectedOnly": true,
                    "mColumns": "visible"
                },
                {
                "sExtends":    "select_all",
                "sButtonText": "Select Filtered",
                "fnClick": function (nButton, oConfig, oFlash) {                                                  
                var oTT = TableTools.fnGetInstance('table_1');
                oTT.fnSelectAll(true); //True = Select only filtered rows (true). Optional - default false.
                    }
                },
                {
                    "sExtends": "select_none",
                    "mColumns": "visible"
                }
            ],
            "sSwfPath": "../MSSQL_api/swf/copy_csv_xls_pdf.swf"
        },
        "colVis": {
            exclude: [ 0 ]
        },
        "scrollX": true,
        "scrollY": "480px",
        "scrollCollapse": true,
        "deferRender": false,
        "autowidth": true,
        "info": true,
        "iDisplayLength": 10,
        "ServerSide": false
    } )
        .columnFilter();
} );

That is my intalization, What do I add where? I cant seem to find the documentation for it. Would I add a new element myself to the CSS?

I want to specifically designate which column how it's text will be aligned.

This discussion has been closed.