Search code examples
c#asp.nethtml-tableborderradiobuttonlist

C# ASP.Net RadioButtonList within table: <td> border also creating border arount LIST ITEMS


I have created a table with borders collapsed around the table and a small gray border on each <td>. However the border is also surrounding each radio button items. The border attribute on the radio button appears to affect another border. How do I delete the border created on the <td> tag from the radio button list items?

    <tr>
        <td colspan="2">
                <asp:Label ID="lblJoint"  CssClass="boldIt" runat="server" Text="Is this for a joint account?" style="float: left; width: 200px;"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:RadioButtonList ID="rdlJoint" runat="server" RepeatDirection="Horizontal" Width="130px" style="float: left;" BorderStyle="None">
                    <asp:ListItem>Yes</asp:ListItem>
                    <asp:ListItem Selected="True">No</asp:ListItem>
                </asp:RadioButtonList>
        </td>
    </tr>

Solution

  • Use Flow RepeatLayout for RadioButtonList or create new css class for it : table.noBorder td { border: none; } and use this class for your radiobuttonlist