Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   HTML Row Height (http://www.velocityreviews.com/forums/t160205-html-row-height.html)

Carl Gilbert 12-06-2004 07:50 PM

HTML Row Height
 
Hi

Simple question...

I have the following code which will give me a row 1 pixel high:

<TR>
<TD height="1">
</TD>
</TR>

However, when I add the following line:

<IMG src="<%=filler%>" height="1" width="100">

in the <TD> tag, the line then expands to about 10 or 15 pixels.

I know the values are minimums but I cannot see anything here that would
force the line to increase in height.

nb. The 'filler' image is just a 1x1 black pixel gif.

Does anyone know what might be causing this and can provide a resolution to
the problem.

Regards, Carl Gilbert



David Dorward 12-06-2004 08:05 PM

Re: HTML Row Height
 
Carl Gilbert wrote:

> I have the following code which will give me a row 1 pixel high:
>
> <TR>
> <TD height="1">


Invalid markup.

> However, when I add the following line:
>
> <IMG src="<%=filler%>" height="1" width="100">
>
> in the <TD> tag, the line then expands to about 10 or 15 pixels.


This has to do with line height. Images are inline data and are (in this
instance at least) treated as character data. The font size therefore
influences the minimum height of the container.

> nb. The 'filler' image is just a 1x1 black pixel gif.


So set a border on some cells instead of simulating it with bandwidth and
maintainence unfriendly markup and graphics.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is

Carl Gilbert 12-06-2004 08:34 PM

Re: HTML Row Height
 
Is there no way to override to height of the column should it contain an
image.

Reason being, I am using a image 5 pixels high and the height pf the inline
data you mentioned exceeds my required height.

Regards, Carl



"Carl Gilbert" <mr_carl_gilbert@hotmail.com> wrote in message
news:pK2td.540$3r4.37@newsfe2-gui.ntli.net...
> Hi
>
> Simple question...
>
> I have the following code which will give me a row 1 pixel high:
>
> <TR>
> <TD height="1">
> </TD>
> </TR>
>
> However, when I add the following line:
>
> <IMG src="<%=filler%>" height="1" width="100">
>
> in the <TD> tag, the line then expands to about 10 or 15 pixels.
>
> I know the values are minimums but I cannot see anything here that would
> force the line to increase in height.
>
> nb. The 'filler' image is just a 1x1 black pixel gif.
>
> Does anyone know what might be causing this and can provide a resolution
> to the problem.
>
> Regards, Carl Gilbert
>




Jeffrey Silverman 12-06-2004 08:43 PM

Re: HTML Row Height
 
On Mon, 06 Dec 2004 19:50:45 +0000, Carl Gilbert wrote:

>
> Does anyone know what might be causing this and can provide a resolution to
> the problem.


Nope, sorry.

But I have to respond just to keep my stats high. later...

--
Jeffrey D. Silverman | jeffreyPANTS@jhu.edu
Website | http://www.newtnotes.com

Drop "PANTS" to reply by email


Mark Parnell 12-06-2004 10:09 PM

Re: HTML Row Height
 
Previously in alt.html, Jeffrey Silverman <jeffrey@pantsjhu.edu> said:

> But I have to respond just to keep my stats high. later...


Cheat! Cheat! Toby, he's padding the stats...

--
Mark Parnell
http://www.clarkecomputers.com.au

Jeffrey Silverman 12-06-2004 10:44 PM

Re: HTML Row Height
 
On Tue, 07 Dec 2004 09:09:52 +1100, Mark Parnell wrote:

> Cheat! Cheat! Toby, he's padding the stats...


Well, I am trying to post original content as well. We'll see who's left
off the stats page *this* week.

Although admittedly I am going on a trip for five days starting Thursday
and I know that that is going to eat into my posting quantity.

Quantity not quality, that's my motto!

oh. hm. no, it's not. I really don't have a motto, CTTOI.

later...

--
Jeffrey D. Silverman | jeffreyPANTS@jhu.edu
Website | http://www.newtnotes.com

Drop "PANTS" to reply by email


Jukka K. Korpela 12-06-2004 10:52 PM

Re: HTML Row Height
 
David Dorward <dorward@yahoo.com> wrote:

>> <TR>
>> <TD height="1">

>
> Invalid markup.


No, it's valid HTML 4.01 Transitional (assuming suitable context of
course).

>> However, when I add the following line:
>>
>> <IMG src="<%=filler%>" height="1" width="100">
>>
>> in the <TD> tag, the line then expands to about 10 or 15 pixels.

>
> This has to do with line height.


In a sense yes.

> Images are inline data and are (in this
> instance at least) treated as character data. The font size therefore
> influences the minimum height of the container.


Not quite. The image itself has the height of one pixel. But, looking
through the URL of the OP's page in my crystal ball, I see that the cell
contains white space character as well. There's a difference between
<td><img ...></td>
and
<td> <img ...> </td>
and line breaks are effectively treated as spaces, so the latter is the
same as
<td>
<img ...>
</td>
(well, in principle it isn't, but let's not go into finer points in SGML
that browser vendors missed). And it's the space character(s) that impose
some minimum height. Whether this is correct is a different issue (it might
be argued that white space should be treated as separators only, not
rendered as such), but anyway it's what browsers generally do.

So removing the white space so that the <td> element contains nothing but
the <img> element makes the cell height smaller. But to get to one pixel,
you need to set the cell spacing (which is typically two pixels by default)
to zero, either with cellspacing="0" in the <table> tag or using
padding:0 in CSS in a rule that applies to the cell.

>> nb. The 'filler' image is just a 1x1 black pixel gif.

>
> So set a border on some cells instead of simulating it with bandwidth and
> maintainence unfriendly markup and graphics.


That's good advice, and it makes the table structure better (helping
nonvisual user agents render it more meaningfully, among other things).

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html



Mark Parnell 12-06-2004 11:07 PM

Re: HTML Row Height
 
Previously in alt.html, Jeffrey Silverman <jeffrey@pantsjhu.edu> said:

> Well, I am trying to post original content as well. We'll see who's left
> off the stats page *this* week.


Probably me again. :-( I'm only here 5 days a week.

--
Mark Parnell
http://www.clarkecomputers.com.au

Carl Gilbert 12-06-2004 11:25 PM

Re: HTML Row Height
 
Thanks for the adive Jukka, this fixed the problem just fine.

And yes, I will bear in mind Davids advice on not using images for 1 pixel
lines but in this case, my line is 5 pixels high.

Regards, Carl




"Jukka K. Korpela" <jkorpela@cs.tut.fi> wrote in message
news:Xns95B8867396C0jkorpelacstutfi@193.229.0.31.. .
> David Dorward <dorward@yahoo.com> wrote:
>
>>> <TR>
>>> <TD height="1">

>>
>> Invalid markup.

>
> No, it's valid HTML 4.01 Transitional (assuming suitable context of
> course).
>
>>> However, when I add the following line:
>>>
>>> <IMG src="<%=filler%>" height="1" width="100">
>>>
>>> in the <TD> tag, the line then expands to about 10 or 15 pixels.

>>
>> This has to do with line height.

>
> In a sense yes.
>
>> Images are inline data and are (in this
>> instance at least) treated as character data. The font size therefore
>> influences the minimum height of the container.

>
> Not quite. The image itself has the height of one pixel. But, looking
> through the URL of the OP's page in my crystal ball, I see that the cell
> contains white space character as well. There's a difference between
> <td><img ...></td>
> and
> <td> <img ...> </td>
> and line breaks are effectively treated as spaces, so the latter is the
> same as
> <td>
> <img ...>
> </td>
> (well, in principle it isn't, but let's not go into finer points in SGML
> that browser vendors missed). And it's the space character(s) that impose
> some minimum height. Whether this is correct is a different issue (it
> might
> be argued that white space should be treated as separators only, not
> rendered as such), but anyway it's what browsers generally do.
>
> So removing the white space so that the <td> element contains nothing but
> the <img> element makes the cell height smaller. But to get to one pixel,
> you need to set the cell spacing (which is typically two pixels by
> default)
> to zero, either with cellspacing="0" in the <table> tag or using
> padding:0 in CSS in a rule that applies to the cell.
>
>>> nb. The 'filler' image is just a 1x1 black pixel gif.

>>
>> So set a border on some cells instead of simulating it with bandwidth and
>> maintainence unfriendly markup and graphics.

>
> That's good advice, and it makes the table structure better (helping
> nonvisual user agents render it more meaningfully, among other things).
>
> --
> Yucca, http://www.cs.tut.fi/~jkorpela/
> Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
>
>




Mark Parnell 12-06-2004 11:30 PM

Re: HTML Row Height
 
Previously in alt.html, Carl Gilbert <mr_carl_gilbert@hotmail.com> said:

> Thanks for the adive Jukka, this fixed the problem just fine.


You mean the one I just answered in another thread? Thanks for that.

> And yes, I will bear in mind Davids advice on not using images for 1 pixel
> lines but in this case, my line is 5 pixels high.


LOL.
You *are* kidding, right?

BTW: Please don't post upside down.
http://www.allmyfaqs.com/faq.pl?How_to_post
http://en.wikipedia.org/wiki/Top-posting

This will help:
http://home.in.tum.de/~jain/software/oe-quotefix/

--
Mark Parnell
http://www.clarkecomputers.com.au


All times are GMT. The time now is 10:20 AM.

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