th value change

th value change

Swetha9090Swetha9090 Posts: 28Questions: 5Answers: 0

Is there a way to change all header values or else can we append string to specified headers

Replies

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    You can use columns.title or you can use standard jQuery or Javascript methods to change the headers values.

    Kevin

  • Swetha9090Swetha9090 Posts: 28Questions: 5Answers: 0

    Any examples

  • Swetha9090Swetha9090 Posts: 28Questions: 5Answers: 0

    Is there any way to change the entire column with header and data to change its position

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    When you say change the entire column, header and data, do you mean something like ColReorder - please see example here.

    If not, please can you explain more what you're trying to achieve, as you haven't given us enough information to help you,

    Colin

  • Swetha9090Swetha9090 Posts: 28Questions: 5Answers: 0

    I need example for appending text to some specified headers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    If you just need to add text, you can either use columns.title as Kevin suggested, or just modify the element directly - please see example here,

    Colin

  • Swetha9090Swetha9090 Posts: 28Questions: 5Answers: 0

    can i use targets:1,2,3,4 iin columndef

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    can i use targets:1,2,3,4 iin columndef

    The columnDefs.targets docs provide all the options available to specify the columns. You can specify an array.

    Kevin

  • Swetha9090Swetha9090 Posts: 28Questions: 5Answers: 0

    But How can I append string to column header

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    You can use my initComplete for that - see updated example here,

    Colin

  • Swetha9090Swetha9090 Posts: 28Questions: 5Answers: 0

    For more than 2 columns how can i append?

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    For more than 2 columns how can i append?

    Are you asking about columnDefs? If yes then see the columnDefs.targets documentation to learn how to specify multiple columns. If this doesn't help then please provide more details of what you are wanting to do.

    Kevin

  • Swetha9090Swetha9090 Posts: 28Questions: 5Answers: 0

    I want to append
    _(underscore) to all the column headers....Is that is possible.If so can you provide with the example

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736

    You can use the jQuery .text() API for this. It is both a getter and a setter. I updated Colin's to show this for one column:
    http://live.datatables.net/cabanege/7/edit

    You can use jQuery each() if you want to loop through some or all the th elements.

    Kevin

  • Swetha9090Swetha9090 Posts: 28Questions: 5Answers: 0

    Can you please provide example in which for all the columns we update _ at the starting position of header like _Name,_Age etc for all headers in the table

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
Sign In or Register to comment.