html - 减少两个 td 之间的空间

标签 html css asp.net

我有一个,其中有很多trtd

目前它在下图中看起来是这样的。

Img2

The area in the arrow needs to be reduced a bit. I tried adding padding but it didn't worked.

下面是html

<table width="100%" border="0" cellspacing="0" cellpadding="5" style="background-color: #EAEFF5">
            <tr>
                <td class="label">
                    Project :
                </td>
                <td class="field" style="width: 10%;">
                    <asp:DropDownList ID="ddlProject" runat="server" Width="80%" AutoPostBack="false">
                        <asp:ListItem Value="0">--Select--</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="label">
                    Taluka :
                </td>
                <td class="field">
                    <%--<asp:TextBox ID="txtTaluka" runat="server" Width="80%"></asp:TextBox>--%>
                    <asp:DropDownList ID="ddlTaluka" runat="server" Width="80%">
                        <%--<asp:ListItem Value="0">--Select--</asp:ListItem>--%>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="label">
                    Transaction Type:
                </td>
                <td class="field" style="width: 30%;">
                    <asp:DropDownList ID="ddlTranType" runat="server" Width="50%" AutoPostBack="true"
                        OnSelectedIndexChanged="ddlTranType_SelectedIndexChanged">
                        <asp:ListItem Value="0">--Select--</asp:ListItem>
                        <asp:ListItem Value="AGR">Agreement Type</asp:ListItem>
                        <asp:ListItem Value="EXP">Expense Type</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="label">
                    7/12 :
                </td>
                <td class="field" style="width: 30%;">
                    <%--<obout:ComboBox ID="ComboBox1" runat="server" Width="180px" Height="150px" AutoClose="false"
                        AllowCustomText="true" AutoValidate="true" AllowEdit="false" SelectionMode="Multiple"
                        DataTextField="COLUMN7_12" DataValueField="COLUMN7_12" OpenOnFocus="true" EmptyText="Select 7/12 ..."
                        EnableVirtualScrolling="true" EnableLoadOnDemand="true" OnLoadingItems="ComboBox1_LoadingItems"
                        Visible="true">
                        <ClientSideEvents OnItemClick="ComboBox1_Click" />
                        <ItemTemplate>
                            <input type="checkbox" runat="server" id="chk712" />
                            <%# Container.Text %>
                        </ItemTemplate>
                        <FooterTemplate>
                            Displaying items
                            <%# Container.ItemsCount > 0 ? "1" : "0" %>-<%# Container.ItemsLoadedCount %>out
                            of
                            <%# Container.ItemsCount %>.
                        </FooterTemplate>
                    </obout:ComboBox>--%>
                    <asp:TextBox ID="txt712" runat="server" Width="60%"></asp:TextBox>
                    <br />
                    <i>Start typing...</i>
                </td>
            </tr>
            <tr>
                <td class="label">
                    Ref No :
                </td>
                <td class="field" style="width: 30%;">
                    <input type="text" id="txtrefno" runat="server" style="width: 60%" />
                    <img src="~/Images/search.gif" alt="Help" onclick="Search_Click()" style="cursor: pointer"
                        id="ImgSearch" runat="server" /><br />
                    <span style="color: #1B1E24;">(Auto Generated field)</span>
                </td>
                <td class="label">
                    Status :
                </td>
                <td class="field" style="width: 30%;">
                    <asp:DropDownList ID="ddlStatus" runat="server" Width="50%" AutoPostBack="false">
                        <asp:ListItem Value="0">--Select--</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="label">
                    Ref Date :
                </td>
                <td class="field" style="width: 30%;">
                    <input type="text" id="txtRefdate" runat="server" style="width: 60%" disabled="disabled" />
                    <%--<cc3:Calendar ID="CalDt1" runat="server" DatePickerMode="true" DatePickerImagePath="../Images/icon2.gif"
                        TextBoxId="txtRefdate" Enabled="true" CultureName="en-GB" DateFormat="dd/MM/yyyy">
                    </cc3:Calendar>--%>
                </td>
                <td class="label">
                    Transaction Date :
                </td>
                <td class="field" style="width: 30%;">
                    <input type="text" id="txtdate" runat="server" style="width: 50%" readonly="readonly" />
                    <cc3:Calendar ID="Calc2" runat="server" DatePickerMode="true" DatePickerImagePath="../Images/icon2.gif"
                        TextBoxId="txtdate" Enabled="true" CultureName="en-GB" DateFormat="dd/MM/yyyy">
                    </cc3:Calendar>
                </td>
            </tr>
            <tr>
                <td class="label">
                    Remarks :
                </td>
                <td>
                    <asp:TextBox ID="txtRemarks" runat="server" Width="80%" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
        </table>

CSS

.label
    {
        width: 20%;
        height: 10%;
    }
    .field
    {
        width: 30%;
        height: 10%;
    }

Fiddle of the html

最佳答案

我会说你应该从表中删除 cellpadding 属性,并通过 css 也这样做。

关于html - 减少两个 td 之间的空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39869177/

相关文章:

javascript - 单击时将查询字符串参数添加到静态链接

javascript - 如果选择单选按钮 Show Div - 8 Radio Buttons/8 Divs - 这可以简化吗?

javascript - 如何使用 jQuery 选择器,获取图像的 src 并将其设置为另一个元素的背景图像?

JavaScript/CSS : Delay between adding element to DOM and its CSS rules being applied?

asp.net - 当 url 包含 4 个或更多路径段时,MVC 3 中的 404 不会触发 Application_Error

javascript - 如何获取用户输入的href值呢?

html - 无法保持特定于一个类/id 的超链接样式

javascript - 仅在第一次单击按钮时增加计数器

asp.net - 如何使用asp.net身份添加具有相同名称的角色和一些自定义列?

c# - 无法解析远程名称 - webclient