YouTip LogoYouTip

Prop Webcontrol Radiobuttonlist Cellpadding

## ASP.NET RadioButtonList CellPadding Property The `CellPadding` property is a member of the ASP.NET `RadioButtonList` control. It is used to define or retrieve the amount of space (in pixels) between the border of a cell and the content inside that cell. --- ## Definition and Usage The `CellPadding` property controls the internal spacing (padding) within each individual item (cell) of a `RadioButtonList` control. By adjusting this property, you can increase or decrease the distance between the radio button selection circle, its associated text label, and the outer boundary of its containing cell. > **Important Note:** The `CellPadding` property is only effective when the `RepeatLayout` property of the `RadioButtonList` is set to `Table` (which is the default layout). If `RepeatLayout` is set to `Flow`, this property will have no effect on the rendered HTML. --- ## Syntax ```xml ``` ### Property Values | Property Value | Description | | :--- | :--- | | `pixels` | An integer value specifying the number of pixels of space between the cell border and its contents. | --- ## Code Example The following example demonstrates how to set the `CellPadding` property to `15` pixels on a `RadioButtonList` control to create a spacious layout for the list items. ```xml <%@ Page Language="C#" %> RadioButtonList CellPadding Example

RadioButtonList CellPadding Demonstration

``` --- ## Key Considerations 1. **Layout Dependency:** As mentioned, `CellPadding` relies on HTML `` rendering. If you are aiming for modern, responsive web designs, you might prefer setting `RepeatLayout="Flow"` or `RepeatLayout="UnorderedList"` and managing the spacing via external CSS (using padding and margin properties on the list elements) rather than relying on the legacy table-based `CellPadding` attribute. 2. **Browser Rendering:** When `RepeatLayout="Table"` is active, ASP.NET renders the control as an HTML `
`. The `CellPadding` property is translated directly into the `cellpadding` attribute of the generated `
` tag.
← Prop Webcontrol RadiobuttonlisProp Webcontrol Panel Wrap β†’

YouTip © 2024-2026 | Home | Learn Technology, Build Dreams!

All content is for educational and learning purposes only.