In my gridview some rows has merged in client side so when i am doing expert to excel in C# rows are not mergeing. So i did it client side.It working well.But now i want to give color to header. Below is my code. Please help me to do it
<div style="width: inherit; height: 40px;" align="right">
<asp:ImageButton ID="img_export" runat="server" ToolTip="Expert to Excel" ImageUrl="~/img/Excel-icon.png"
Width="30px" Height="25px" Visible="false" Style="margin-right: 4px; margin-top: 10px;" />
</div>
<div id="viewTable" class="table-responsive">
<table>
<tr>
<td colspan="13" rowspan="2" style="text-align: center;">
<h5>
<asp:Label ID="lblmsg" runat="server" Text=""></asp:Label></h5>
</td>
</tr>
</table>
<div id="divReport" runat="server">
<asp:GridView ID="grdDailyOccupancy" runat="server" AutoGenerateColumns="False" CellPadding="0"
ItemStyle-VerticalAlign="Top" PagerStyle-PageButtonCount="10" class="table table-bordered table-responsive"
DataKeyNames="PropertyID" HeaderStyle-CssClass="GVHeader" ShowFooter="true">
<Columns>
<asp:BoundField HeaderText="Sl#" DataField="SlNo"></asp:BoundField>
<asp:BoundField HeaderText="Hotel Name" DataField="PropertyName">
<ItemStyle Width="20%" />
</asp:BoundField>
<asp:BoundField HeaderText="Customer Name" DataField="CustomerName">
<ItemStyle Width="20%" />
</asp:BoundField>
<asp:BoundField HeaderText="Date and Time of Booking" DataField="BillDate">
<ItemStyle Width="20%" />
</asp:BoundField>
<asp:BoundField HeaderText="Checkin Date" DataField="CheckinDate">
<ItemStyle Width="15%" />
</asp:BoundField>
<asp:BoundField HeaderText="Checkout Date" DataField="CheckOutDate">
<ItemStyle Width="15%" />
</asp:BoundField>
<asp:TemplateField HeaderStyle-CssClass="noPrint" ControlStyle-CssClass="noPrint"
FooterStyle-CssClass="noPrint" ItemStyle-CssClass="noPrint">
<HeaderTemplate>
Booking Refrerence No.</HeaderTemplate>
<ItemTemplate>
<a href="#" class="viewDetail" data-bookingid='<%#String.Format("{0}",Eval("BookingID"))%>'>
<%#String.Format("{0}", Eval("BookingRefNo"))%></a>
</ItemTemplate>
<HeaderStyle Width="150px" />
<ItemStyle Width="150px" />
</asp:TemplateField>
<asp:BoundField HeaderText="No. of Room Booked" DataField="TotalNoOfRoom">
<ItemStyle Width="20%" />
</asp:BoundField>
<asp:BoundField HeaderText="Booking Source" DataField="PaymentMode">
<ItemStyle Width="20%" />
</asp:BoundField>
<asp:TemplateField HeaderText="Booked By">
<ItemTemplate>
<asp:Label ID="lblExtraPersonName" runat="server" Text='<%#Eval("ExtraPersonName") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTExtraPersonName" runat="server" Text="Total"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total Amount">
<ItemTemplate>
<asp:Label ID="lblTotalAmount" runat="server" Text='<%#Eval("TotalAmount") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTTotalAmount" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tax Type">
<ItemTemplate>
<asp:Label ID="lblTaxType" runat="server" Text='<%#Eval("TaxType") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTTaxType" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Tax Amount">
<ItemTemplate>
<asp:Label ID="lblTaxAmount" runat="server" Text='<%#Eval("TaxAmount") %>'></asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTTaxAmount" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<div style="height: 20px; padding: 5px; font-weight: bold; font-size: medium; color: silver">
No Records Found.
</div>
</EmptyDataTemplate>
<HeaderStyle Font-Bold="True" />
<PagerStyle CssClass="paging" />
</asp:GridView>
</div>
</div>
<div style="float: right;" class="noPrint" id="divPaging" runat="server">
<uc1:Pagingnation ID="uclPager" runat="server" />
<asp:HiddenField ID="hdnCurrentIndex" runat="server" Value="Blank Value" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript" language="javascript">
Sys.Application.add_load(function () {
groupTable($('#mainContent_grdDailyOccupancy tr:has(td)'), 0, 12);
$('#mainContent_grdDailyOccupancy .deleted').remove();
$('.date-picker').datepicker({
autoclose: true,
todayHighlight: true
});
//export to excel
$("[id$=img_export]").click(function (e) {
window.open('data:application/vnd.ms-excel,' + encodeURIComponent($('div[id$=viewTable]').html()));
e.preventDefault();
});
});
</script>