YouTip LogoYouTip

Prop Webcontrol Table Gridlines

## ASP.NET Table GridLines Property The `GridLines` property is a member of the ASP.NET `Table` Web Control. It is used to get or set the gridline style displayed between the cells of a `Table` control. --- ## Definition and Usage The `GridLines` property specifies whether the borders between the cells of the `Table` control are visible. You can configure it to display only horizontal gridlines, only vertical gridlines, both, or none at all. --- ## Syntax ```xml ``` ### Property Values | Value | Description | | :--- | :--- | | `None` | No gridlines are rendered. (Default value) | | `Horizontal` | Only horizontal gridlines (between rows) are rendered. | | `Vertical` | Only vertical gridlines (between columns) are rendered. | | `Both` | Both horizontal and vertical gridlines are rendered. | --- ## Code Example The following example demonstrates how to set the `GridLines` property to `"Both"` to display all borders within the table. ```xml <%@ Page Language="C#" %> ASP.NET Table GridLines Example
Row 1, Cell 1 Row 1, Cell 2 Row 2, Cell 1 Row 2, Cell 2
``` --- ## Technical Considerations * **Browser Compatibility:** The rendering of gridlines depends on the client's browser supporting HTML table borders. * **CSS Alternatives:** While the `GridLines` property is a quick way to style tables in Web Forms, modern web development often favors using external CSS stylesheets (e.g., targeting `td` and `th` elements with `border` properties) for cleaner separation of concerns and more precise design control.
← Prop Webcontrol Table HorizontProp Webcontrol Table Cellspac β†’