468,242 Members | 1,471 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

How to Fix the size of <td></td>?

George Lft
I'm new at building table. Mostly PHP programming . Now I can't seem to fix the size of my table row and column. Any idea?

<h4>Two rows and three columns:</h4>
<table border="1">
<tr>
<td>10000000000000</td>
<td>200</td>
<td>300</td>
</tr>
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
</table>
Look at the first td. It expanded. Can I fix it so it won't expand??? I'm going to place various sizes of images. So I want all of them to be fixed in one size. How should i do that?
Mar 19 '08 #1
4 4817
nomad
664 Expert 512MB
I'm new at building table. Mostly PHP programming . Now I can't seem to fix the size of my table row and column. Any idea?

<h4>Two rows and three columns:</h4>
<table border="1">
<tr>
<td>10000000000000</td>
<td>200</td>
<td>300</td>
</tr>
<tr>
<td>400</td>
<td>500</td>
<td>600</td>
</tr>
</table>
Look at the first td. It expanded. Can I fix it so it won't expand??? I'm going to place various sizes of images. So I want all of them to be fixed in one size. How should i do that?
Your big value or row is the 10000000000000

so you have to figure out the size for that row and its 112px
so from there you have have the <td width="your value here"> all your cols/rows need to be the same width.
So show me what the code will be?

nomad
Mar 19 '08 #2
Your big value or row is the 10000000000000

so you have to figure out the size for that row and its 112px
so from there you have have the <td width="your value here"> all your cols/rows need to be the same width.
So show me what the code will be?

nomad
No, nomad, I've tried putting in the <td width="" height=""></td> I've tried px, cm and even %.

When my pic size is big, it'll stretch it no matter how I fixed the size.

Now if I were to make the size of the pics smaller to match each of the rest of the pics, it'll be very tedious. So, now I want to know there must be a way to fix the <td></td> or anything else that can hold the pic so it's fixed with the size. an all the pics are in same size...

Any idea?
Mar 20 '08 #3
What exactly do you want to happen?

If you want to specify a fixed width that does not expand when the contents expand then you must use "table-layout:fixed" and specifying a "height" and "width".
What the browser then does with the overflowing text can be decided by using "overflow"
Mar 20 '08 #4
Thanks guys, Everyone, I've resolved this, using array, with some table attributes, ...
Mar 20 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by bissatch | last post: by
1 post views Thread by test9991014 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.