The following is a CSS file I wrote.CodeCopy to a tablet and save it *. CSS
For example, the name is 1024.css.
/* --------------------------- DataGrid --------------------------------*/
. DataGrid
{
Font-family: verdana, Arial, Helvetica, sans-serif;
Width: 100%;
Border: solid 1px blue;
Table-layout: fixed;
Border-collapse: Separate;
}
. Dg_header
{
Font-weight: bold;
Color: # ffffff;
Background-color: # 4a3c8c;
Border: solid 1px red;
}
. Dg_alter
{
Background-color: # e7e7ff;
Border: solid 1px red;
}
. Dg_item
{
Color: #330099;
Background-color: # f7f7f7;
Border: solid 1px red;
}
. Dg_page
{
Border: solid 1px red;
}
Then add the following sentence to the HTML code of the aspx file:
Write dg_header in the cssclass attribute in the headerstyle of the DataGrid
Write dg_item in itemstyle
REFERENCE The dg_header class in the style sheet, so that you can set the style you want at will, just modify the CSS file.