0

I created a table to organize my items on a page. The page is an edit page for a property. I used colspan to expand rows and put a textbox within rows and set the textbox wdith to 100%, However, the textbox width still only takes the space of 1 column not 3 columns like I expected here is the code

 <table align="left" style="width: 100%; float: left" class="FormFormatTable">

    <tr>
        <td style="width: 10%; height: 60px">Alert Name</td>
        <td colspan="3" style=" ">
            <asp:TextBox CssClass="inputBoxes" ID="txtBox_alertName" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td style="width: 10%; height: 60px;">Alert</td>
        <td style="height: 60px; ">
            <asp:DropDownList ID="ddl_AlertTime" runat="server">
                <asp:ListItem Value="1">After</asp:ListItem>
                <asp:ListItem Value="0">Immediately</asp:ListItem>
            </asp:DropDownList>
        </td>
        <td style="height: 60px; ">
            <input id="demo_vertical0" type="number"/></td>
        <td style="height: 60px">
            <asp:DropDownList ID="DropDownList1" runat="server">
                <asp:ListItem>Seconds</asp:ListItem>
                <asp:ListItem>Minutes</asp:ListItem>
                <asp:ListItem>Hours</asp:ListItem>
            </asp:DropDownList>
        </td>
    </tr>
    <tr>
        <td style="width: 10%">Severity</td>
        <td style=" height: 60px"" >
            <asp:DropDownList ID="ddl_Severity" runat="server">
                <asp:ListItem Value="1">After</asp:ListItem>
                <asp:ListItem Value="0">Immediately</asp:ListItem>
            </asp:DropDownList>
        </td>
        <td style="">&nbsp;</td>
        <td>&nbsp;</td>
    </tr>
    <tr style="height:60px">
        <td style="width: 10%">Receipients</td>
        <td colspan="3" style="">
            <asp:TextBox CssClass="inputBoxes" ID="txtBox_Receipients" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr style="height:60px">
        <td style="width: 10%">Subject Title</td>
        <td colspan="3" style="">
            <asp:TextBox CssClass="inputBoxes" ID="txtBox_SubjectTitle" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr style="height:60px">
        <td style="width: 10%">Alert Messsage</td>
        <td colspan="3" style="">
            <asp:TextBox CssClass="inputBoxes" ID="txtBox_AlertMessage" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr style="height:60px">
        <td style="width: 10%; ">Notification Window</td>
        <td style=" ">
            <asp:TextBox CssClass="inputBoxes"  ID="txtBox_NotificationWindow" runat="server"></asp:TextBox>
        </td>
        <td style=" "></td>
        <td style="height: 60px"></td>
    </tr>
    <tr style="height:60px">
        <td style="width: 10%; ">Notification Frequency</td>
        <td style=" ">
            <input id="demo_vertical" type="number"/>
        </td>
        <td style=" "></td>
        <td style="height: 60px"></td>
    </tr>
    <tr style="height:60px">
        <td style="width: 10%">Fields to Display in Details</td>
        <td colspan="3" style="">
            <asp:TextBox CssClass="inputBoxes" ID="txtBox_SubjectTitle3" runat="server"></asp:TextBox>
        </td>
    </tr>
</table>

css is simple just this

.inputBoxes {
    width: 100%;
}

why is this?

a screenshot of my page on my computer enter image description here

5
  • Please could you create a JS fiddle demonstrating the problem and/or the generated html. Commented Sep 5, 2014 at 20:46
  • Your very first statement I created a table to organize my items on a page. is already not recommended... stackoverflow.com/questions/83073/… Commented Sep 5, 2014 at 20:51
  • strange it works in JS fiddle this link when I paste in the direct html generated however it doesn't work when I compile and run I have the website posted here testingnan.azurewebsites.net/editcontent however if I test it in js fiddle using t he code from view source at the webpage and add in the css at this link IT WORKS WHYYY???????????? JS fiddle link jsfiddle.net/tw02j22t Commented Sep 5, 2014 at 20:53
  • Does the CSS class FormFormatTable contain anything that manipulates the rows and columns? Commented Sep 5, 2014 at 20:56
  • no I deleted that css already but why does it renders different from JS fiddle and the actual page? Commented Sep 5, 2014 at 20:59

2 Answers 2

2

In you HTML the Alert Name , Receipients ,Subject Title ,Alert Messsage ,Fields to Display in Details TextBoxs take 3 columns .

Notification Window take one columns because you don't set colspan

enter image description here

you must add colspan="3" to your td of notfication

 <td  colspan="3" style=" ">
        <asp:TextBox CssClass="inputBoxes"  ID="txtBox_NotificationWindow" runat="server"></asp:TextBox>
    </td>
Sign up to request clarification or add additional context in comments.

14 Comments

problem is not notification window is the fact on my computer the VERY first row alert name takes the same width as notification window I don't know why it is doing that
notification window only take that long is intended
be sure your browser not cache old html , delete history or press ctrl+f5 to reload your page
and what is the class="FormFormatTable"
sorry about that I deleted that css already because I feared it could meddle with my css so it is no longer present so it is not doing anything
|
0

You have an extra quote in the following line (the cell definition that contains your ddl_Severity control).

<td style=" height: 60px"" >

Maybe remove this quote, and see if that fixes it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.