How to apply style on data rows but not header in Excel
How to apply style on data rows but not header in Excel
databody
Posts: 11Questions: 3Answers: 0
So I want to apply some style like wrap text and I am using following code but it also applies style on header row which I don't want. I only want style to be applied on data rows. How to make it possible?
customize: function( xlsx ) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
$('row c[r^="D"]', sheet).attr( 's', '55' );
$('row c[r^="F"]', sheet).attr( 's', '55' );
}
This question has an accepted answers - jump to answer
Answers
This thread may give you some hints on how to achieve this:
https://datatables.net/forums/discussion/comment/167672/#Comment_167672
This could already bring you pretty close to a solution. If your header is two cols high start with i=2 etc.
Thanks it worked. But there is slight problem with above code i.e. you have written rows.lenght and instead it should be rows.length
Right! I typed much of the code directly into the form ... then you get typos, sorry
One thing to know: You can't apply multiple built-in styles to the same cell or row. Because the styles overwrite each other. That is when the trouble starts: You have to define your own styles and that is cumbersome. You'll find much on this in the forum in case you need it.