Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make of the Gridview Column Center and Right Align (MiddleRight)

I need to align the values inside the Grid View to to Center and Right. Because I need to align Currency.

And other Columns need to be aligned Center and Left.

Can you Help me doing This??

I'm currently Doing This.

<asp:TemplateField ItemStyle-HorizontalAlign="Right" HeaderText="Amount">
    <ItemTemplate>Rs.<%# Eval("Payable_Bill_Amount","{0:n}")%></ItemTemplate>
</asp:TemplateField>

This Aligns the Content to totally Right. I need to align the Content to Right But Also to Center Like Calculations We Do

Ex:

 Required          Current

|    10.00  |   |     10.00|

|   110.00  |   |    110.00| 

|  1210.00  |   |   1210.00|
----------
like image 536
Krishna Thota Avatar asked Sep 11 '12 07:09

Krishna Thota


People also ask

How do I center align a column?

Select the cells that have the text you want aligned. To horizontally align text, pick Align Text Left , Center , or Align Text Right . When you have a long line of text, part of the text might not be visible. To fix this without changing the column width, click Wrap Text.

How to align-items in grid?

Aligning items on the Block Axis. The align-self and align-items properties control alignment on the block axis. When we use these properties, we are changing the alignment of the item within the grid area you have placed it.

How do I align a column in CSS?

For aligning columns to the left, the align-content property will set to 'flex-start'. For aligning columns to the right, the align-content property will set to 'flex-end'. For aligning columns to the extreme ends, the align-content property will set to 'space-between'.

How to justify-content center in grid CSS?

One of the easiest ways of centering the content of grid items is using Flexbox. Set the display to "grid" for the grid container, and "flex" for grid items. Then, add the align-items and justify-content properties, both with the "center" value, to grid items.


1 Answers

How about aligning them to the right using

ItemStyle-HorizontalAlign="Right"

and then using CSS padding to add some space around the edge of the value in the cell?

like image 68
chead23 Avatar answered Sep 22 '22 16:09

chead23