This is a migrated thread and some comments may be shown as answers.

Not able to remove space between table and control using CellSpacing=”0”

1 Answer 309 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Manishkumar
Top achievements
Rank 1
Manishkumar asked on 11 Oct 2012, 10:55 AM

Hi,
I have taken a Radgrid, in which in one column cell, I have 2 controls. I want to
remove margin between table border and control.

 
In RadGrid, I have applied following properties.

<telerik:RadGrid . . . . .

CellSpacing="0" cellpadding="0" . . . . . >


Code:
<ItemTemplate>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
   
<tr>
 <td style="border: 1;">
  <asp:TextBox ID="txtTest" runat="server" TextMode="multiline" Width="100%"   Rows="2" Text='<%#DataBinder.Eval(Container.DataItem, "Test")%>'>
</asp:TextBox>
</td>
</tr>
  
<tr>
 <td style="border: 1;" align="right">
 <asp:ImageButton class="clsbuttonsize" ID="btnDotsTest" runat="server" ImageUrl="~/Images/btn_Test.gif"                                                                     ToolTip="Click to view and update the Test." />
</td>
</tr>
  
</table>
<asp:HiddenField ID="hdnTest" runat="server" Value='<%#DataBinder.Eval(Container.DataItem, "Test")%>' />
 </ItemTemplate>

Still I am not able remove margin between border and control.

 

I have attached the screenshot.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 16 Oct 2012, 10:57 AM
Hi Manishkumar,

You will need to set the cell padding to your cells:
<td style="padding: 0;">
or use CSS to achieve the requested appearance. In your case you can try:
<style type="text/css">
    .RadGrid .rgRow td td,
    .RadGridt .rgAltRow td td,
    .RadGrid .rgEditRow td td
    {
        padding: 0;
    }
</style>

I hope this will prove helpful.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Manishkumar
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or