PDA

View Full Version : Table & Column widths


Robert Bell
06-09-2003, 03:45 PM
Hi

I was wondering if anybody out there could help me with this problem I'm having.

I'm trying to dynamically set some columns in a table depending on how many values there are. The table is displayed below.

<table width="100%">
<tr height="23px">
<% lnumber = 0
while lnumber < lcurrcount %>
<td width="10%"><%= lvalues(lcurrcount) %></td>
<% lnumber = lnumber + 1
wend %>
</tr>
</table>

Now if lcurrcount is under five there is no problems, the table looks fine. But if theres more that ten then they run to close together, ignoring the width and the only thing setting the width of the column is the length of the values in the array.

Anybody got any ideas?
Thanks.

brothercake
06-09-2003, 04:29 PM
If there's more than 10 then the width percentages are going to add up to more than 100%, hence a problem.

If you have a count variable, use that to calculate and write-in the % width of each TD.