Author |
Topic  |
|
Nikkol
Forum Moderator
    
USA
6907 Posts |
Posted - 21 December 2002 : 14:53:03
|
I have this bit of code:
<table width="100%">
<tr class="hcell"><td align="center" colspan="2">Board Information</td></tr>
<tr><td class="small" align="right"><b>Position:</b></td>
<td><select style="width:100%" name="position" class="formel">
<option value="0">Select Position</option>
<%
do while not positions.eof
response.write("<option value=""" & positions(0) & """ ")
if brdmem("boardposition") = positions(0) then response.write("selected")
response.write(">" & positions(1) & "</option>")
positions.movenext
loop
%>
</select></td></tr>
<tr><td class="small" align="right"><b>Term Ends:</b></td>
<td valign="top">
<input type="text" class="formel" name="yearoff" style="width:100%" value="<%= brdmem("yearoff") %>">
</td></tr>
</table>
And the table isn't laying out correctly. Looks something like:
Board Postion
Position: [select box]
Year Off: [2003 ]
Rather than what I would expect:
Board Postion
Position: [select box ]
Year Off: [2003 ]
Any idea why and how I can fix it? |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 21 December 2002 : 15:12:09
|
Should work. Try this way or by taking out the class="formel"
<td><select name="position" class="formel" style="width:100%">
|
 |
|
Nikkol
Forum Moderator
    
USA
6907 Posts |
Posted - 21 December 2002 : 15:18:28
|
nope. neither worked. i sorta fixed it by adding the following to my code:
<table width="100%">
<tr class="hcell"><td align="center" colspan="2">Board Information</td></tr>
<tr><td class="small" align="right"><b>Position:</b></td>
<td width="100%"><select style="width:100%" name="position" class="formel">
<option value="0">Select Position</option>
<%
do while not positions.eof
response.write("<option value=""" & positions(0) & """ ")
if brdmem("boardposition") = positions(0) then response.write("selected")
response.write(">" & positions(1) & "</option>")
positions.movenext
loop
%>
</select></td></tr>
<tr><td nowrap class="small" align="right"><b>Term Ends:</b></td>
<td valign="top">
<input type="text" class="formel" name="yearoff" style="width:100%" value="<%= brdmem("yearoff") %>">
</td></tr>
</table>
it's not the best solution but at least it lays out correctly in IE. it bothers me though that i can't figure out WHY it doesn't work the other way. |
Edited by - Nikkol on 21 December 2002 15:19:20 |
 |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 21 December 2002 : 15:28:36
|
Works for me. Check here
<%@ Language=VBScript %>
<table width="100%">
<tr class="hcell"><td width="100"></td><td align="center">Board Information</td></tr>
<tr><td width="100" class="small" align="right"><b>Position:</b></td>
<td><select style="width:100%" name="position" class="formel">
<option value="0">Select Position</option>
<%
positions = array("2001", "2002", "2003", "2004", "2005", "2006")
for i = 0 to 5
response.write("<option value=""" & positions(i) & """ ")
if i = 4 then response.write("selected")
response.write(">" & positions(i) & "</option>")
next
%>
</select></td></tr>
<tr><td width="100" class="small" align="right"><b>Term Ends:</b></td>
<td valign="top">
<input type="text" class="formel" name="yearoff" style="width:100%" value="2003">
</td></tr>
</table> |
 |
|
Nikkol
Forum Moderator
    
USA
6907 Posts |
Posted - 21 December 2002 : 15:32:16
|
maybe it's because the table is actually in a cell in another table? thanks GB for going to all this trouble to help me figure this out. you're cool  |
 |
|
Nikkol
Forum Moderator
    
USA
6907 Posts |
Posted - 21 December 2002 : 15:41:52
|
Okay, I noticed you have width="100" in the label cells. So I added that and now it works. Funny thing though with width="90" there looks like there is plenty of room, but it ends up looking like:
| Board Postion |
| Position: [select box] |
| Year Off: [2003 ] |
|
 |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 21 December 2002 : 15:47:23
|
That is one reason. When you do not specify the width for the column cells, each cell is assumed equal width by the browsers.
Another reason which will affect the size of the select list is the coulumn which contains the table for your select list and the other column are assigned no widths. In that case the length of the contents of each column will affect how it appears to the user. Keep the width of your column in which table for select box appears fixed to overcome that problem. |
Edited by - GauravBhabu on 21 December 2002 15:48:18 |
 |
|
Nikkol
Forum Moderator
    
USA
6907 Posts |
Posted - 21 December 2002 : 15:49:11
|
yeah, turns out that specifying the widths of the label cells actually did not work (ended up cutting off the text inside the select box). specifying the width of the cell with the width box seems to be the only solution. |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
 |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 21 December 2002 : 15:58:29
|
the structure should be something like this
<%@ Language=VBScript %>
<table width="100%">
<tr>
<td Width="300">Column With Select List
<table width="100%">
<tr class="hcell">
<td width="100"></td>
<td align="center">Board Information</td>
</tr>
<tr>
<td width="100" class="small" align="right"><b>Position:</b></td>
<td>
<select style="width:100%" name="position" class="formel">
<option value="0">Select Position</option>
<%
positions = array("2001", "2002", "2003", "2004", "2005", "2006")
for i = 0 to 5
response.write("<option value=""" & positions(i) & """ ")
if i = 4 then response.write("selected")
response.write(">" & positions(i) & "</option>")
next
%>
</select>
</td>
</tr>
<tr>
<td width="100" class="small" align="right"><b>Term Ends:</b></td>
<td valign="top">
<input type="text" class="formel" name="yearoff" style="width:100%" value="2003">
</td>
</tr>
</table>
</td>
<td valign="top">Other Column</td>
</tr>
<tr>
<td Colspan="2">-----Second Row------</TD>
</tr>
</table> |
 |
|
|
Topic  |
|