Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define CellPadding in GridView in ASP.NET

  • I autoformat a GridView in ASP.NET.
  • It looks nice but the headers all run together like this:

    idfirstNamelastNameage

  • I set CellPadding="5" but it does nothing.

How can I set the cell padding of the headers and all cells?

A D D E N D U M :

Thanks Andrew, I fixed it with this. Works in Firefox and Explorer 7:

.gridview2 tr td
{
    padding: 5px;
    border: 1px solid #ddd;
}
.gridview2 tr th
{
    padding: 5px;
}
like image 810
Edward Tanguay Avatar asked Nov 25 '08 10:11

Edward Tanguay


1 Answers

GridView also has a property "CellPadding" and "CellSpacing" that can help us do this.

like image 148
MOZILLA Avatar answered Oct 21 '22 13:10

MOZILLA