Page 1 of 1

simple tables question in php

Posted: Fri Jul 07, 2006 11:44 am
by dirgeshp
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


i am trying to make a 2 cells in a table using php

the problem is ... i have set the WIDTH and yet...the cell STILL keeps getting bigger...

is there a way to make it so the CELL does not get bigger and stays CONSTANT no matter what..


[syntax="html"]<table border="1" width="100%" id="table1">
	<tr>
		<td width="100">ddddddddddddddddddddddd</td>
		<td width="200">ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd</td>
	</tr>
</table>

feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Fri Jul 07, 2006 11:52 am
by feyd
Set the overflow style property.

Posted: Fri Jul 07, 2006 11:58 am
by GM
That was my reaction too, but I've tested and it doesn't seem to work on the TD elements.

EDIT: It does work on DIV elements, so a solution might be to put a DIV item inside the TD item, and set the overflow on that.

Posted: Fri Jul 07, 2006 12:01 pm
by Dave Lohran
I believe you could surround it with a div, and use the overflow setting on that.

Posted: Fri Jul 07, 2006 12:13 pm
by dirgeshp
I am sorry .. but i tried that and it still doesn't work

i am testing on FIREFOX

any suggestions or point to examples please?

Posted: Fri Jul 07, 2006 12:16 pm
by Dave Lohran
Every box object scales to fit the content inside of it. It looks like you're not using overflow correctly or something.
Would you please show us your code?
P.S. I don't think tables support overflow.

Posted: Fri Jul 07, 2006 12:22 pm
by dirgeshp
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


[syntax="html"]<table border="1" width="10%" id="table1" height="50">
	<tr>
		<td style="width: 50px; border: 1px solid red;overflow:auto;">
		dddddddddddddddddddddddddddddddddddddddddddddddddddd</td>
	</tr>
</table>

feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Fri Jul 07, 2006 12:27 pm
by GM
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


overflow doesn't work in TD elements. You need to do

[syntax="html"]<TD>
<DIV style="overflow: auto; width: 200px">
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
</DIV>
</TD>
I've not tested, but it should do the trick.


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Fri Jul 07, 2006 12:59 pm
by dirgeshp
That doesn't work either....seems as though the CELL is getting wider and wider