Buttons not staying on same line

Discussion in 'HTML' started by tshad, Jan 4, 2005.

  1. tshad

    tshad Guest

    I can't seem to make some of my columns line up correctly.

    I have stripped out some html code to demonstrate the problem.

    If you run the following code, you will see that the "update" and "cancel"
    buttons are on top of each other. This has something to do with the <td
    width="100%">.

    If I change those lines to <td>, the buttons line up but then the cells on
    the left are messed up and the "edit" buttons cell is out to the same size
    as the 2 button cell.

    I was trying to use the "100%" to control the sizes of the other cells. It
    all works perfectly if I only have one button in the top cell (even if it is
    a larger size than the "edit" button). The problem happens when I have 2
    buttons in the cell. The browser insists on putting them on top of each
    other instead of next to each other.

    Is there a way to force the 2 buttons to be next to each other?

    Here is the code, (the extra tags would normally have other things in them):

    ******************************************************************************************
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Add New Company</title>
    <body>
    <form name="Form1" method="post" action="addScreenQuestions.aspx"
    id="Form1">
    <table border="0" width="550" >
    <tr>
    <td>
    <table id="DataList1" cellspacing="0" cellpadding="0" Border="0"
    border="0" width="100%" style="margin:0">
    <tr>
    <td>
    <table border="1" width="100%" CellPadding="0" CellSpacing="0"
    style="margin:0">
    <tr>
    <td width=30>&nbsp;

    </td>
    <td>
    </td>
    <td width="100%">
    How many years have you been working in C#
    </td>
    <td width="140">
    <input type="submit" name="DataList1:_ctl0:_ctl0" value="Update and
    play" />
    <input type="submit" name="DataList1:_ctl0:_ctl1" value="Cancel" />
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td class="alternateRow">
    <table border="1" width="100%" CellPadding="0" CellSpacing="0"
    style="margin:0">
    <tr>
    <td>&nbsp;
    </td>
    <td>
    </td>
    <td width="100%">
    How many years have you been working in VB.Net
    </td>
    <td width="140">
    <input type="submit" name="DataList1:_ctl2:_ctl0" value="Edit" />
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td align="Center">
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    ******************************************************************************************

    Thanks,

    Tom.
     
    tshad, Jan 4, 2005
    #1
    1. Advertising

  2. tshad

    tshad Guest

    Sorry,

    I made a couple of changes that made my example mess up.

    Here is the corrected example:

    *******************************************************************************************
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Add New Company</title>
    <body>
    <form name="Form1" method="post" action="addScreenQuestions.aspx"
    id="Form1">
    <table border="0" width="550" >
    <tr>
    <td>
    <table id="DataList1" cellspacing="0" cellpadding="0" Border="0"
    border="0" width="100%" style="margin:0">
    <tr>
    <td>
    <table border="1" width="100%" CellPadding="0" CellSpacing="0"
    style="margin:0">
    <tr>
    <td width=30>&nbsp;

    </td>
    <td>
    </td>
    <td width="100%">
    Have you been working in C#
    </td>
    <td width="170">
    <input type="submit" name="DataList1:_ctl0:_ctl0"
    value="Update/Play" />
    <input type="submit" name="DataList1:_ctl0:_ctl1" value="Cancel" />
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td class="alternateRow">
    <table border="1" width="100%" CellPadding="0" CellSpacing="0"
    style="margin:0">
    <tr>
    <td>&nbsp;
    </td>
    <td>
    </td>
    <td width="100%">
    Have you been working in VB.Net
    </td>
    <td width="170">
    <input type="submit" name="DataList1:_ctl2:_ctl0" value="Edit" />
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td align="Center">
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    *******************************************************************************************

    Thanks

    Tom

    "tshad" <> wrote in message
    news:XLlCd.6349$...
    >I can't seem to make some of my columns line up correctly.
    >
    > I have stripped out some html code to demonstrate the problem.
    >
    > If you run the following code, you will see that the "update" and "cancel"
    > buttons are on top of each other. This has something to do with the <td
    > width="100%">.
    >
    > If I change those lines to <td>, the buttons line up but then the cells on
    > the left are messed up and the "edit" buttons cell is out to the same size
    > as the 2 button cell.
    >
    > I was trying to use the "100%" to control the sizes of the other cells.
    > It all works perfectly if I only have one button in the top cell (even if
    > it is a larger size than the "edit" button). The problem happens when I
    > have 2 buttons in the cell. The browser insists on putting them on top of
    > each other instead of next to each other.
    >
    > Is there a way to force the 2 buttons to be next to each other?
    >
    > Here is the code, (the extra tags would normally have other things in
    > them):
    >
    > ******************************************************************************************
    > <html>
    > <head>
    > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    > <title>Add New Company</title>
    > <body>
    > <form name="Form1" method="post" action="addScreenQuestions.aspx"
    > id="Form1">
    > <table border="0" width="550" >
    > <tr>
    > <td>
    > <table id="DataList1" cellspacing="0" cellpadding="0" Border="0"
    > border="0" width="100%" style="margin:0">
    > <tr>
    > <td>
    > <table border="1" width="100%" CellPadding="0" CellSpacing="0"
    > style="margin:0">
    > <tr>
    > <td width=30>&nbsp;
    >
    > </td>
    > <td>
    > </td>
    > <td width="100%">
    > How many years have you been working in C#
    > </td>
    > <td width="140">
    > <input type="submit" name="DataList1:_ctl0:_ctl0" value="Update
    > and play" />
    > <input type="submit" name="DataList1:_ctl0:_ctl1" value="Cancel"
    > />
    > </td>
    > </tr>
    > </table>
    > </td>
    > </tr>
    > <tr>
    > <td class="alternateRow">
    > <table border="1" width="100%" CellPadding="0" CellSpacing="0"
    > style="margin:0">
    > <tr>
    > <td>&nbsp;
    > </td>
    > <td>
    > </td>
    > <td width="100%">
    > How many years have you been working in VB.Net
    > </td>
    > <td width="140">
    > <input type="submit" name="DataList1:_ctl2:_ctl0" value="Edit" />
    > </td>
    > </tr>
    > </table>
    > </td>
    > </tr>
    > <tr>
    > <td align="Center">
    > </td>
    > </tr>
    > </table>
    > </td>
    > </tr>
    > </table>
    > </form>
    > </body>
    > </html>
    > ******************************************************************************************
    >
    > Thanks,
    >
    > Tom.
    >
     
    tshad, Jan 4, 2005
    #2
    1. Advertising

  3. tshad

    rf Guest

    "tshad" <> wrote

    > I can't seem to make some of my columns line up correctly.
    >
    > I have stripped out some html code to demonstrate the problem.


    <snip code>

    Why so many nested tables?

    --
    Cheers
    Richard.
     
    rf, Jan 4, 2005
    #3
  4. tshad

    rf Guest

    "tshad" <> wrote

    > Sorry,
    >
    > I made a couple of changes that made my example mess up.
    >
    > Here is the corrected example:


    Post a URL, not a bunch of code which still might be wrong and which I have
    to copy/paste into an editor, probably changing something in the process.

    --
    Cheers
    Richard.
     
    rf, Jan 4, 2005
    #4
  5. tshad

    Mark Parnell Guest

    Mark Parnell, Jan 4, 2005
    #5
  6. tshad

    tshad Guest

    "rf" <rf@.invalid> wrote in message
    news:QWlCd.102447$...
    > "tshad" <> wrote
    >
    >> Sorry,
    >>
    >> I made a couple of changes that made my example mess up.
    >>
    >> Here is the corrected example:

    >
    > Post a URL, not a bunch of code which still might be wrong and which I
    > have
    > to copy/paste into an editor, probably changing something in the process.


    Sorry,

    I have no way to that, yet.

    Tom
    >
    > --
    > Cheers
    > Richard.
    >
    >
     
    tshad, Jan 4, 2005
    #6
  7. tshad

    tshad Guest

    "rf" <rf@.invalid> wrote in message
    news:tTlCd.102442$...
    > "tshad" <> wrote
    >
    >> I can't seem to make some of my columns line up correctly.
    >>
    >> I have stripped out some html code to demonstrate the problem.

    >
    > <snip code>
    >
    > Why so many nested tables?


    This is actually an asp.net page that has DataGrids nested inside a
    DataList. The asp:datalist generates a table as does the asp:DataGrid.

    My problem has nothing to do with asp, however. What I did was take the
    generated html page and strip out the unnecessary parts, so as to not
    confuse the problem.

    Tom
    >
    > --
    > Cheers
    > Richard.
    >
    >
     
    tshad, Jan 4, 2005
    #7
  8. tshad

    tshad Guest

    tshad, Jan 4, 2005
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Scovetta
    Replies:
    0
    Views:
    3,123
    Michael Scovetta
    Jun 4, 2003
  2. Patio87
    Replies:
    4
    Views:
    433
    Julie
    Aug 18, 2004
  3. Irmen de Jong
    Replies:
    0
    Views:
    702
    Irmen de Jong
    Jun 25, 2003
  4. Peter Hansen
    Replies:
    1
    Views:
    721
    Amos Joshua
    Jun 29, 2003
  5. wk6pack
    Replies:
    10
    Views:
    260
    wk6pack
    Feb 26, 2004
Loading...

Share This Page