but when i build then there is no effect in grid view
And gridview in html
<tableid="tabledata"></table>
When i apply this then gridview is display with simple where as i want to apply this css in gridview when i apply this then gridview display without formatting.. what i try
Secondly, as you do, the .addClass() method could be used to add the specified class(es) to matched elements, you could use F12 developer tools to select table cells and check the actual CSS styles applied to
the cells. Besides, it seems that you’d like to specify CSS styles for table cells, you could try to implement it via CSS.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Secondly, as you do, the .addClass() method could be used to add the specified class(es) to matched elements, you could use F12 developer tools to select table cells and check the actual CSS styles applied to
the cells. Besides, it seems that you’d like to specify CSS styles for table cells, you could try to implement it via CSS.
do you find the error with the above code snippet? and <tr> will be missing its closing tag
</tr>.
Besides, it seems that you are not familiar with using jQuery to find the elements and perform the elements. In a word, we need to make sure that we find the element we want before we do operations with the element.
And F12 developer tools is a good tool for developer to find and fix html and javascript issues, you could spend some time to learn using F12 developer tools.
Best Regards,
Fei Han
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
239 Points
1074 Posts
CSS class in jquery
Jul 18, 2016 10:02 AM|Capricon User|LINK
I want to apply a CSS class to a gridview. I tried to apply this style reference link, so I try this
UPDATE
ok i update these lines in jquyer after
but when i build then there is no effect in grid view
And gridview in html
When i apply this then gridview is display with simple where as i want to apply this css in gridview when i apply this then gridview display without formatting.. what i try
what i want
So how i apply css ?? any solution?
Member
81 Points
44 Posts
Re: CSS class in jquery
Jul 18, 2016 12:38 PM|arun banik|LINK
you may try something like this. For example...
Member
239 Points
1074 Posts
Re: CSS class in jquery
Jul 19, 2016 04:57 AM|Capricon User|LINK
thank for reply when i try this after if (final[i] !== null) {
css not effect on gridview
All-Star
40535 Points
6233 Posts
Microsoft
Re: CSS class in jquery
Jul 19, 2016 05:32 AM|Fei Han - MSFT|LINK
Hi Bakhtawar Ashiq,
Firstly, the code snippet is not correct, please modify the code to this.
Secondly, as you do, the .addClass() method could be used to add the specified class(es) to matched elements, you could use F12 developer tools to select table cells and check the actual CSS styles applied to the cells. Besides, it seems that you’d like to specify CSS styles for table cells, you could try to implement it via CSS.
Best Regards,
Fei Han
Member
239 Points
1074 Posts
Re: CSS class in jquery
Jul 19, 2016 06:08 AM|Capricon User|LINK
thnak for reply
You mean i remove this if (final[i] !== null) { ???
and in this
and in this
which code i use this
$("th").addClass("GridviewScrollHeader");
$("td").addClass("GridviewScrollItem");
or something else?
Member
239 Points
1074 Posts
Re: CSS class in jquery
Jul 19, 2016 08:34 AM|Capricon User|LINK
any solutions please?
Member
270 Points
79 Posts
Re: CSS class in jquery
Jul 20, 2016 10:31 AM|bugwee|LINK
to make it simple you can add the class during creation or records to display.
Member
239 Points
1074 Posts
Re: CSS class in jquery
Jul 20, 2016 12:17 PM|Capricon User|LINK
i try this but not work so i tried this one and this work for me anyways thanku
$("#tabledata tr:first").addClass('GridviewScrollHeader');
$("#tabledata tr").addClass('GridviewScrollItem');
All-Star
40535 Points
6233 Posts
Microsoft
Re: CSS class in jquery
Jul 22, 2016 07:12 AM|Fei Han - MSFT|LINK
Hi Bakhtawar Ashiq,
You misunderstand my meaning, you generate table row (tr) and append to table using
do you find the error with the above code snippet? and <tr> will be missing its closing tag </tr>.
Besides, it seems that you are not familiar with using jQuery to find the elements and perform the elements. In a word, we need to make sure that we find the element we want before we do operations with the element.
And F12 developer tools is a good tool for developer to find and fix html and javascript issues, you could spend some time to learn using F12 developer tools.
Best Regards,
Fei Han