By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,836 Members | 2,059 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,836 IT Pros & Developers. It's quick & easy.

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

George Lft
P: 26
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
Share this Question
Share on Google+
4 Replies


nomad
Expert 100+
P: 664
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

George Lft
P: 26
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

P: 8
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

George Lft
P: 26
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.