I've been attempting to align the headers of a gridview to the right, but so far I haven't had any success. I've tried using center alignment as well but that didn't work either. Specifically, I want the headers for the CR and DR columns to be aligned to the right. I've looked at several articles for help, but none of them have provided a solution.
<asp:GridView ID="GridViewLedger" runat="server" Width="100%" AutoGenerateColumns="False"
ShowFooter="True" DataKeyNames="AccountID"
CssClass="table table-hover table-striped table-bordered">
<Columns>
<asp:BoundField HeaderText="Account Title" DataField="AccountTitle" ItemStyle-CssClass="visible-desktop"
HeaderStyle-CssClass="visible-desktop">
<HeaderStyle CssClass="visible-desktop"></HeaderStyle>
<ItemStyle Width="11%" />
</asp:BoundField>
<asp:BoundField HeaderText="Voucher No" DataField="VoucherNumber" ItemStyle-CssClass="visible-desktop"
HeaderStyle-CssClass="visible-desktop">
<HeaderStyle CssClass="visible-desktop"></HeaderStyle>
<ItemStyle Width="8%"></ItemStyle>
</asp:BoundField>
<asp:BoundField HeaderText="Chq No" DataField="ChequeNumber" ItemStyle-CssClass="visible-desktop"
HeaderStyle-CssClass="visible-desktop">
<HeaderStyle CssClass="visible-desktop"></HeaderStyle>
<ItemStyle Width="8%" CssClass="visible-desktop"></ItemStyle>
</asp:BoundField>
<asp:BoundField HeaderText="DateTime" DataFormatString="{0:dd/MMM/yyyy hh:mm}" HtmlEncode="false" DataField="TransactionDateTime" ItemStyle-CssClass="visible-desktop"
HeaderStyle-CssClass="visible-desktop">
<HeaderStyle CssClass="visible-desktop"></HeaderStyle>
<ItemStyle Width="13%" CssClass="visible-desktop"></ItemStyle>
</asp:BoundField>
<asp:BoundField HeaderText="InvoiceNo" DataField="InvoiceNo" ItemStyle-CssClass="visible-desktop"
HeaderStyle-CssClass="visible-desktop">
<HeaderStyle CssClass="visible-desktop"></HeaderStyle>
<ItemStyle Width="3%" CssClass="visible-desktop" ></ItemStyle>
</asp:BoundField>
<asp:BoundField HeaderText="Particulars" DataField="Particulars" ItemStyle-CssClass="visible-desktop"
HeaderStyle-CssClass="visible-desktop">
<HeaderStyle CssClass="visible-desktop"></HeaderStyle>
<ItemStyle CssClass="visible-desktop" Width="30%"></ItemStyle>
</asp:BoundField>
<asp:BoundField HeaderText="DR" DataField="DR" ItemStyle-CssClass="visible-desktop"
HeaderStyle-CssClass="visible-desktop">
<HeaderStyle CssClass="visible-desktop" HorizontalAlign="Right"></HeaderStyle>
<ItemStyle CssClass="visible-desktop" Width="8%" HorizontalAlign="Right"></ItemStyle>
</asp:BoundField>
<asp:BoundField HeaderText="CR" DataField="CR" ItemStyle-CssClass="visible-desktop"
HeaderStyle-CssClass="visible-desktop">
<HeaderStyle CssClass="visible-desktop" HorizontalAlign="Right"></HeaderStyle>
<ItemStyle CssClass="visible-desktop" HorizontalAlign="Right"></ItemStyle>
</asp:BoundField>
<asp:BoundField HeaderText="Amount" DataField="Amount" ItemStyle-CssClass="visible-desktop"
HeaderStyle-CssClass="visible-desktop">
<HeaderStyle CssClass="visible-desktop"></HeaderStyle>
<ItemStyle CssClass="visible-desktop"></ItemStyle>
</asp:BoundField>
</Columns>
</asp:GridView>