Buttons not staying on same line

T

tshad

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.
 
T

tshad

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
 
R

rf

tshad said:
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?
 
R

rf

tshad said:
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.
 
T

tshad

rf said:
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
 
T

tshad

rf said:
<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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top