Below is a CSS file I wrote to copy the following code to a writepiece *. CSS
Document, for example named 1024.css
/ * ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------ * /. 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: #ffff; 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_HEADERITEMSTYLE in the CSSClass property in DataGrid's headerstyle to write DG_ItemStyle
It is the DG_HEADER class in the style sheet, so you can set the style you want, just modify the CSS file.
For the first time, please pay more attention.