defining width of rows in a table

liunx

Guest
hi,<br />
<br />
i'm creating a table that will display results retrieved from a database. for the table i've already specified what the width of each row and column should be using code as the this:<br />
<br />
<table width="700"<br />
<tr><br />
<td width="100">......</td><br />
<td width="20"> .....<td><br />
...<br />
..<br />
.<br />
<br />
i want the table to look exactly in those dimensions. the problem is when i retrieve results from the database, some of them might be long and screws up my measurements. for example instead of the first cell being 100 and the second 20, the first might be 50 and the second becomes 70. how can i make it so that the dimensions are static.<br />
<br />
thanks,<br />
anna<!--content-->Unless what your putting into the table cells s an image, it should wrap to fit in the table cell, could you please post you exact code? Ill be glad to help you out.<!--content-->The table cell will always expand to fit in the text or image that is required to fit in there.<br />
<br />
Using a fixed pixel width is always a little touch and go, it can look perfect on your screen but when someone with either a large monitor or a small monitor thats when the trouble starts. Using a % is safer.<!--content-->even when i use a percentage the same happens. i don't mind the table being shrink or magnified because of a visiter's moniter. what i don't like is the proportions of the table being changed. <br />
<br />
as for the content they're results of database queries such as :<br />
<br />
<tr><br />
<td width="150"> Recordset1.Fields("field1").Value </td><br />
<tr><br />
<br />
thanks,<br />
anna<!--content-->keep you <td> cells as width="170" or so and just change your table width to 100%<br />
<br />
that way the table can only get so big and the text will have to be broke<!--content-->this works in keeping the cell proportional to each other but then the size of the table is huge. it takes up the whole screen. <br />
<br />
any other suggestions?<br />
<br />
thanks,<br />
anna<!--content-->I assume you are running on a 1024x768 resolution.<br />
<br />
Set the table width to 70% of the screen size.<br />
<br />
How about a dummy row:<br />
<br />
<br />
<table><br />
<tr><br />
<!-- this is to define the width of each column --><br />
<td width="50"></td><br />
<td width="90"></td><br />
..<br />
</tr><br />
<br />
<tr><br />
<!-- this is the row which contains the first content --><br />
<td>Content</td><br />
<td>Content</td><br />
..<br />
</tr><br />
..<br />
</table><!--content-->Originally posted by anna2110 <br />
this works in keeping the cell proportional to each other but then the size of the table is huge. it takes up the whole screen. <br />
<br />
any other suggestions?<br />
<br />
thanks,<br />
anna <br />
I thought that is what you want? if you don't want it at 100% just do like Horus_Kol said and make it 70% or whatever.<!--content-->
 
Back
Top