Help with table in ASP/.NET 2.0!

I'm a bit new to web programming, and this table is driving me crazy. I want to design the thing in the visual interface and make it as compact as possible. The problem is, when I go to resize columns, as they get smaller, others get bigger. At first I thought I had fixed the size of the table with a width= command, but there is none to be found. What else would fix the size of the table? I just want to click on the columns and resize them (like one would do in excel). Also it will look one way in the design editor, but when I go to run the application, colums widths and heights will change.

It's so frustrating wasting this much time on simple formatting! Help!

For kicks here is my HTML side sourecode:

Thanks,

Terry

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="auditfile.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td style="width: 255px">
                    Hospital</td>
                <td colspan = "3" style="width: 54px" >
                    <asp:TextBox ID="hospital" runat="server" TabIndex="4"  Enabled="False" Width="424px"></asp:TextBox>&nbsp;
                </td>
                <td style="width: 67px">
                </td>
                <td style="width: 187px"  >
                </td>
                <td style="width: 107px" >
                </td>
                <td colspan="2" style="width: 251px" >
                    <asp:Button ID="newb" runat="server" Text="New" Width="46px" /><asp:Button
                        ID="editb" runat="server" Text="Edit" Width="44px" /><asp:Button
                            ID="deleteb" runat="server" Text="Delete" Width="44px" /><asp:Button ID="cancelb"
                                runat="server" Text="Cancel" Width="47px" /><asp:Button ID="saveb" runat="server" TabIndex="17" Text="Save" Width="47px" /></td>
            </tr>
            <tr>
                <td style="width: 255px">
                    Patient</td>
                <td colspan = "4" style="width: 500px">
                    <asp:TextBox ID="paccount" runat="server" TabIndex="4" Width="90px"></asp:TextBox>
                    <asp:TextBox ID="pname" runat="server" TabIndex="4" Width="325px"></asp:TextBox></td>
                <td style="width: 187px">
                </td>
                <td style="width: 107px">
                    </td>
                <td style="width: 34px">
                    </td>
                <td style="width: 23px">
                </td>
            </tr>
            <tr>
                <td style="height: 14px; width: 255px;">
                    Date Admi</td>
                <td colspan = "2" style="width: 127px;  height: 14px;">
                    <asp:TextBox ID="dateadmi" runat="server" TabIndex="4" Width="92px"></asp:TextBox></td>
                <td style="width: 65px;  height: 14px;">
                    Bill Total</td>
                <td style="width: 67px; height: 14px;">
                    <asp:TextBox ID="btotal" runat="server" TabIndex="4" Width="95px"></asp:TextBox></td>
                <td style="width: 187px;  height: 14px;">
                    </td>
                <td style="width: 107px;  height: 14px;">
                    </td>
                <td style="width: 34px;  height: 14px;">
                </td>
                <td style="width: 23px; height: 14px;">
                </td>
            </tr>
            <tr>
                <td style="height: 14px; width: 255px;">
                    Date Disc</td>
                <td colspan = "2" style="height: 14px;">
                    <asp:TextBox ID="datedisc" runat="server" TabIndex="4" Width="92px"></asp:TextBox></td>
                <td style=" height: 14px;">
                    Total
                    Unders</td>
                <td style="height: 14px;">
                    <asp:TextBox ID="tunder" runat="server" TabIndex="8" Width="95px" Enabled="False"></asp:TextBox></td>
                <td style="height: 14px; width: 187px;">
                    </td>
                <td style="height: 14px;">
                    </td>
                <td style=" height: 14px; width: 34px;">
                </td>
                <td style=" height: 14px; width: 23px;">
                </td>
            </tr>
            <tr>
                <td style="height: 14px; width: 255px;">
                    Class</td>
                <td colspan = "2" style="width: 127px; height: 14px;">
                    <asp:DropDownList ID="fclass" runat="server" Font-Size="10pt" TabIndex="6" Width="150px">
                    </asp:DropDownList></td>
                <td style="width: 100px; height: 14px;">
                    Total
                    Overs</td>
                <td style="width: 67px; height: 14px;">
                    <asp:TextBox ID="tover" runat="server" TabIndex="9" Width="95px" Enabled="False"></asp:TextBox></td>
                <td style="width: 187px; height: 14px;">
                    </td>
                <td style="width: 107px; height: 14px;">
                    </td>
                <td style="width: 34px; height: 14px;">
                </td>
                <td style="width: 23px; height: 14px;">
                </td>
            </tr>
            <tr>
                <td style="height: 14px; width: 255px;">
                    HMA Code</td>
                <td colspan = "2" style="width: 175px; height: 14px;">
                    <asp:DropDownList ID="hmacode" runat="server" Font-Size="10pt" TabIndex="7" Width="149px">
                    </asp:DropDownList></td>
                <td style="width: 65px; height: 14px;">
                </td>
                <td style="width: 67px; height: 14px;">
                </td>
                <td style="width: 187px; height: 14px;">
                    &nbsp;</td>
                <td style="width: 107px; height: 14px;">
                </td>
                <td colspan = 2 style="width: 150px; height: 14px;">
                <asp:Button ID="newitem" runat="server" Text="New" Width="46px" OnClick="newitem_Click" /><asp:Button ID="cancelitem"
                                runat="server" Text="Cancel" Width="47px" /><asp:Button ID="saveitem" runat="server" TabIndex="17" Text="Save" Width="47px" OnClick="saveitem_Click" /></td>
            </tr>
            <tr>
                <td style="height: 24px; width: 255px;">
                    Lineno</td>
                <td style="width: 54px; height: 24px;">
                    &nbsp; Code</td>
                <td style="width: 86px; height: 24px;">
                    &nbsp;Dept</td>
                <td style="width: 65px; height: 24px">
                    &nbsp;Descrip</td>
                <td style="width: 67px; height: 24px">
                    &nbsp;Serv Date</td>
                <td style="width: 187px; height: 24px;">
                    &nbsp;Unit Price</td>
                <td style="width: 107px; height: 24px;">
                    Qty</td>
                <td style="width: 34px; height: 24px;">
                    &nbsp;TC</td>
                <td style="width: 23px; height: 24px">
                    Reason</td>
            </tr>
            <tr>
                <td style="height: 14px; width: 255px;">
                    <asp:TextBox ID="lineno" runat="server" Enabled="False" TabIndex="4" Width="48px"></asp:TextBox></td>
                <td style="width: 54px; height: 14px;">
                    <asp:TextBox ID="servcode" runat="server" TabIndex="4" Width="92px"></asp:TextBox></td>
                <td style="width: 86px; height: 14px;">
                    <asp:TextBox ID="aarea" runat="server" TabIndex="4" Width="46px"></asp:TextBox></td>
                <td style="width: 65px; height: 14px;">
                    <asp:TextBox ID="descrip" runat="server" TabIndex="4" Width="295px"></asp:TextBox></td>
                <td style="width: 67px; height: 14px;">
                    <asp:TextBox ID="servdate" runat="server" TabIndex="4" Width="78px"></asp:TextBox></td>
                <td style="width: 187px; height: 14px;">
                    <asp:TextBox ID="uprice" runat="server" TabIndex="4" Width="54px"></asp:TextBox></td>
                <td style="width: 107px; height: 14px;">
                    <asp:TextBox ID="qty" runat="server" TabIndex="4" Width="46px"></asp:TextBox></td>
                <td style="width: 34px; height: 14px;">
                    <asp:TextBox ID="trancode" runat="server" TabIndex="4" Width="62px"></asp:TextBox></td>
                <td style="width: 23px; height: 14px">
                    <asp:TextBox ID="rcode" runat="server" TabIndex="4" Width="50px"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 255px">
                </td>
                <td style="width: 54px">
                </td>
                <td style="width: 86px">
                </td>
                <td style="width: 65px">
                </td>
                <td style="width: 67px">
                </td>
                <td style="width: 187px">
                </td>
                <td style="width: 107px">
                </td>
                <td style="width: 34px">
                </td>
                <td style="width: 23px">
                </td>
            </tr>
            <tr>
                <td colspan="9" style="height: 190px">
                    <asp:GridView ID="detail" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        Font-Size="8.25pt" ForeColor="#333333" GridLines="None" HorizontalAlign="Left" Style="border-left-color: #000000;
                        border-bottom-color: #000000; border-top-color: #000000; border-right-color: #000000"
                        Width="800px" OnSelectedIndexChanged="detail_SelectedIndexChanged" Height="70px">
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <Columns>
                            <asp:CommandField ButtonType="Button" ShowSelectButton="True" SelectText="X">
                                <HeaderStyle Width="10px" />
                                <ItemStyle Height="10px" />
                            </asp:CommandField>
                            <asp:BoundField DataField="lineno" HeaderText="Line">
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Left"  Height = "15px"/>
                                <HeaderStyle HorizontalAlign="Left" Font-Size="Small" />
                            </asp:BoundField>
                            <asp:BoundField DataField="servcode" HeaderText="Serv Code">
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Left"  Height = "15px"/>
                                <HeaderStyle HorizontalAlign="Left" Font-Size="Small" />
                            </asp:BoundField>
                            <asp:BoundField DataField="aarea" HeaderText="Dept">
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Left"  Height = "15px"/>
                                <HeaderStyle HorizontalAlign="Left" Font-Size="Small" />
                            </asp:BoundField>
                            <asp:BoundField DataField="descrip" HeaderText="Description">
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Left" Width="200px" Height = "15px"/>
                                <HeaderStyle HorizontalAlign="Left" Font-Size="Small" />
                            </asp:BoundField>
                            <asp:BoundField DataField="uprice" HeaderText="Unit Price">
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Right"  Height = "15px"/>
                                <HeaderStyle HorizontalAlign="Right" Font-Size="Small" />
                            </asp:BoundField>
                            <asp:BoundField DataField="servdate" HeaderText="Serv Date">
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Left"  Height = "15px"/>
                                <HeaderStyle HorizontalAlign="Left" Font-Size="Small" />
                            </asp:BoundField>
                            <asp:BoundField DataField="qty" HeaderText="Qty">
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Right"  Height = "15px"/>
                                <HeaderStyle HorizontalAlign="Right" Font-Size="Small" />
                            </asp:BoundField>
                            <asp:BoundField DataField="trancode" HeaderText="Tran Code">
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Left"  Height = "15px"/>
                                <HeaderStyle HorizontalAlign="Left" Font-Size="Small" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Reason" DataField="rcode" >
                                <ItemStyle Font-Size="Medium"  Height = "15px"/>
                                <HeaderStyle Font-Size="Small" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Under Chg" DataField="ucharge" >
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Right"  Height = "15px"/>
                                <HeaderStyle Font-Size="Small" HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField HeaderText="Over Chg" DataField="ocharge" >
                                <ItemStyle Font-Size="Medium" HorizontalAlign="Right"  Height = "15px"/>
                                <HeaderStyle Font-Size="Small" HorizontalAlign="Right" />
                            </asp:BoundField>
                        </Columns>
                        <RowStyle BackColor="#EFF3FB"  Height = "15px" />
                        <EditRowStyle BackColor="#2461BF" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <br />
        &nbsp;<br />
        <br />
        <br />
        <asp:Label ID="errorlabel" runat="server" Height="108px" Width="356px"></asp:Label>
       
       
   
    </div>
    </form>
</body>
</html>
TerryBurgerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

QPRCommented:
Things that dictate the width of your table....
The width of the table tag, the widths of the TD tags, the content of your table e.g. images or nested tables.
If you want to state the width of the table in design mode then first go through all your code removing all instances of width="" then go back to the design view and drag the columns to suit.
I don't know which html editor you are using but some have a habit of adding widths even after you have removed the width values.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.