How to align added records fields ?

How to align added records fields ?

aakpaakp Posts: 4Questions: 0Answers: 0
edited November 2011 in General
I have a table which has Some fields left aligned, some fields center aligned and numeric fields right aligned. When click add and saved all fields are coming left aligned only. I also have a field which is non editable and does not show-up in add button and has default value. This is center aligned but when added this also comes left aligned. Kindly help.

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    How do you tell the browser to align the fields - presumably with a class? If you have an add button which is adding a new row then you'll need to set the classes for the new row as well. The easiest way is to let DataTables do it and use the sClass property, or you could just use standard jQuery / DOM methods.

    Allan
  • aakpaakp Posts: 4Questions: 0Answers: 0
    Thanks for the response. I tried out following thing.

    [code]
    "aoColumnDefs" : [
    { "sClass": 'center', "aTargets": [ "_all" ] }
    [/code]

    Still added column is aligned to left side of the cell.
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Can you link to your example please? I presume you have td.center { text-align: center; } in your CSS?

    Allan
This discussion has been closed.