I have a DataTable that is created in code behind. I need to right justify the number column and I also want to bold the last column of the DataTable with a dollar sign in the beginning. I also need to put commas for the numbers. below is my cs page code:
DataTable dt = new DataTable("Table");
dt.Columns.Add(new DataColumn("Title"));
dt.Columns.Add(new DataColumn("Number));
dt.Rows.Add("Number", 12.3);
dt.Rows.Add("Pages", 45789);
dt.Rows.Add("requirements", 23456);
dt.Rows.Add("Price", 12);
dt.Rows.Add("Property", 25);
dt.Rows.Add("test1", 0);
dt.Rows.Add("Total", total);
grdCalculate.DataSource = dt;
grdCalculate.DataBind();
below is my .aspx page code:
<asp:GridView ID="grdCalculate" runat="server" GridLines="Horizontal" CssClass="grid"></asp:GridView>
below is something, I want:
I want something this way so that its easier to add the columns:
1234.00
1
6
7
9
45609.00
If I apply this stylesheet:
table tr td:nth-child(2)
{
text-align:right !important;
}
This is how the numbers look like:
I want something like this:
14
6
6
82500.00
0
10
20
0
10
0