viv_acious
viv_acious

Reputation: 2489

How to decrease the space between vertical radiobuttonlist

I have a vertical radiobuttonList sitting in a table.

How do I decrease the spacings between each of the listitems so that the total height of radiobuttonList is smaller?

I have tried using padding and margin but none seems to work.

enter image description here

Upvotes: 2

Views: 3088

Answers (5)

PTansey
PTansey

Reputation: 576

I changed the radiobuttonlist to use RepeatLayout="Flow" instead of RepeatLayout="Table"

eg:

<asp:RadioButtonList ID="radOrderBy" runat="server" AutoPostBack="True" RepeatLayout="Flow" >
    <asp:ListItem Value="NAME" Text="Name" Selected="True" />
    <asp:ListItem Value="NUMBER" Text="Number" />
</asp:RadioButtonList>

Upvotes: 0

7alhashmi
7alhashmi

Reputation: 924

you can just add this inside the radiobuttonlist tag:

 <asp:RadioButtonList ID="RadioButtonList1" runat="server" Width="300px">

Upvotes: 2

Daniel Imms
Daniel Imms

Reputation: 50189

Provided this w3schools demo demonstrates accurate markup, it looks like they're built in a table. Try this:

.someClassName td {
    padding: 0;
    margin: 0;
}

Replacing .someClassName with the CssClass of the RadioButtonList or some other wrapper object.

Upvotes: 0

Manish Sharma
Manish Sharma

Reputation: 1720

radiobuttonList in a table so try cellspacing="0" cellpadding="0" and padding:0; for td also

Upvotes: 0

Saurabh
Saurabh

Reputation: 5727

Use CellPadding property of RadioButtonList, you can set 0 for minimum height

<asp:RadioButtonList ID="rdlst" runat="server" CellPadding="15" CellSpacing="0"  ><asp:ListItem Value="1" Text="1"></asp:ListItem> <asp:ListItem Value="2" Text="2"></asp:ListItem></asp:RadioButtonList>

Upvotes: 2

Related Questions