Click to See Complete Forum and Search --> : table cell fit to it's contents
pelegk1
03-21-2005, 08:49 AM
how can i makea cell of table to fit to its content
so it will be execlly in the size of the content it contains?
thnaks in advance
peleg
slipsixx
03-21-2005, 09:35 AM
Just use a <table> tag with no predetermined size.
phpnovice
03-21-2005, 10:49 AM
There are other factors that determine table cell size -- such as the size of other cells in the same column (for width) and row (for height). However, looking just at the cell and its internal area, you would specify the following to get the cell to hug its content tightly:
<td style="padding:0;">
This, of course, presumes that the content itself has not specified any outer margins. Thus, you may want to specify the following style setting in the primary tag for the content.
style="margin:0;"
slipsixx
03-21-2005, 04:07 PM
Or just <td cellpadding="0" cellmargin="0">
phpnovice
03-21-2005, 06:09 PM
Originally posted by slipsixx
Or just <td cellpadding="0" cellmargin="0">
Deprecated. ;) However, cell margin is for the spaces between cells -- not the spaces inside the cell padding where the content has a margin. For example, place a FORM inside a table cell and you'll still have extra space in spite of that specification you gave.
pelegk1
03-22-2005, 12:35 AM
what else can i change?
PeOfEo
03-22-2005, 01:35 AM
Originally posted by pelegk1
what else can i change? what exactly is happening? Link?
pelegk1
03-22-2005, 01:38 AM
you will see that in the first table there are spacing in the cells
PeOfEo
03-22-2005, 02:01 AM
You mean that red I guess?
just do this
style="border:0px; margin-left:0px; margin-right:0px;
Now if this still leaves a border make the margin negative, -1px for the right margin of the left will stretch the cell and cause it to overlap the space.
hebrew looks cool.
pelegk1
03-22-2005, 02:41 AM
try it on the zip i attached and see if you succed .
hebrew is always god beacuse its saint
phpnovice
03-22-2005, 08:27 AM
As I said previously... There are other factors that determine table cell size -- such as the size of other cells in the same column (for width) and row (for height). In your case, you've got to also consider the height of the image, buttons, input fields, and dropdown box, too.