Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   DIV wider than TD (cell) (http://www.velocityreviews.com/forums/t162322-div-wider-than-td-cell.html)

gorbus 07-29-2005 08:09 AM

DIV wider than TD (cell)
 
I put DIV into table cell. DIV is POSITION:RELATIVE. TOP and LEFT
properties of DIV works fine but not WIDTH. When DIV is wider than TD,
TD is also wider... WHY ?


Gorb

PLEASE help


Els 07-29-2005 08:10 AM

Re: DIV wider than TD (cell)
 
gorbus wrote:

> I put DIV into table cell. DIV is POSITION:RELATIVE. TOP and LEFT
> properties of DIV works fine but not WIDTH. When DIV is wider than TD,
> TD is also wider... WHY ?


Because that's what TD's do. What would be the result you're after?

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -

gorbus 07-29-2005 09:05 AM

Re: DIV wider than TD (cell)
 
In short: I'd like to show div which is bigger than td. I inserted it
into TD, because I want to position DIV relatively to TD. Is it
possible ?
And of course: TD cannot change its size....


Els 07-29-2005 09:24 AM

Re: DIV wider than TD (cell)
 
gorbus wrote:

> In short: I'd like to show div which is bigger than td. I inserted it
> into TD, because I want to position DIV relatively to TD. Is it
> possible ?
> And of course: TD cannot change its size....


This makes no sense to me, but maybe what you are looking for, is
position:absolute, not relative. To make it relative to the TD, you
could give that TD position:relative, and the DIV position:absolute.

It does sound like a very ugly hack though, for something that most
likely could be done in a proper way. However, without seeing your
page or understanding your objective, I can't offer a different
method.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -

gorbus 07-29-2005 11:30 AM

Re: DIV wider than TD (cell)
 
I did as u said but it didn't help - TD is still 200px and should be
100px (when rendered of course):

<TD style="WIDTH: 100px; POSITION: relative" vAlign="top" width="100"
height="100">

<DIV style="LEFT: 50px; WIDTH: 200px; POSITION: relative;
BACKGROUND-COLOR: red">sample text</DIV>

</TD>


Els 07-29-2005 11:41 AM

Re: DIV wider than TD (cell)
 
gorbus wrote:

> I did as u said but it didn't help - TD is still 200px and should be
> 100px (when rendered of course):
>
> <TD style="WIDTH: 100px; POSITION: relative" vAlign="top" width="100"
> height="100">
>
> <DIV style="LEFT: 50px; WIDTH: 200px; POSITION: relative;
> BACKGROUND-COLOR: red">sample text</DIV>
>
> </TD>


If only you would quote the relevant bits of the message you are
replying to, you would notice a very distinct discrepancy between what
I wrote and what you did.

Hint: relative != absolute

;-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -
Now playing: Bodysnatchers - Ruder Than You

gorbus 07-29-2005 02:22 PM

Re: DIV wider than TD (cell)
 
And this 'hint' is enought! Thanks, u help me v. much.

Gorb


Animesh Kumar 07-29-2005 10:07 PM

Re: DIV wider than TD (cell)
 
gorbus wrote:

> I did as u said but it didn't help - TD is still 200px and should be
> 100px (when rendered of course):
>
> <TD style="WIDTH: 100px; POSITION: relative" vAlign="top" width="100"
> height="100">


You may also want to put a semi-colon after "relative" and "color: red"
in the style field. (Just to be safe).

>
> <DIV style="LEFT: 50px; WIDTH: 200px; POSITION: relative;
> BACKGROUND-COLOR: red">sample text</DIV>
>
> </TD>
>


Noodles Jefferson 07-30-2005 09:43 PM

Re: DIV wider than TD (cell)
 
In article <1122627945.154335.105240@z14g2000cwz.googlegroups .com>,
gorbus (gorbus@interia.pl) dropped a +5 bundle of words...

> In short: I'd like to show div which is bigger than td. I inserted it
> into TD, because I want to position DIV relatively to TD. Is it
> possible ?
> And of course: TD cannot change its size....


Your div's going to be forced to fit the td. Now, you can position the
div within the td through say <div style="vertical-align:top"> or <div
style="padding-left:.3em"> (for example) but it's still not going to be
bigger than your td. Once you use table, the boxes are pretty much
locked down to a set position. Now, you can use the rowspan and colspan
to get a big td instead of say two little td's, just don't forget that
each cell you do like that means less cells in whichever rows apply.

<table border="1">
<tr>
<td colspan="2">This takes up two td's horizontally</td>
<td>This would be the one on the end</td>
</tr>
<td rowspan="2">This one takes up two td's vertically</td>
<td>This one will be in the middle of the second row</td>
<td>This one's on the end of the second tow.</td>
</tr>
<tr>
<td>This one will be in the middle of the third row</td>
<td>This one will be on the end of the third row</td>
</tr>
</table>


--
Noodles Jefferson
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM

"Our earth is degenerate in these latter days, bribery and corruption
are common, children no longer obey their parents and the end of the
world is evidently approaching."
--Assyrian clay tablet 2800 B.C.


All times are GMT. The time now is 12:04 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.