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

correct equivalent construct for 1 line of code

P: n/a

Hello, for the following code, VS suggests that construct (width=
height= ) is out of date and a newer one
is recommended:

<table><tr><td width="92" height="38" valign="middle">AnyThing</td></
tr></table>
Would you please tell me the right construct (clearly must be
functionally equivalent).
(I have tried with style= and vertical-align, but I get an incorrect
vertical alignment :-( )

Thanks

-Pam

Apr 15 '07 #1
Share this Question
Share on Google+
27 Replies


P: n/a
Scripsit pamela fluente:
Hello, for the following code,
As usual, a URL says more than 1,000 bytes of code, especially when the code
has been copied incorrectly, as it usually is.
VS suggests that construct (width=
height= ) is out of date and a newer one
is recommended:
What's VS and why do you care? There's little point in cleaning up clumsy
presentational markup. It's much easier to start afresh, applying good
design principles.
<table><tr><td width="92" height="38" valign="middle">AnyThing</td></
tr></table>
Google Groups, a poor choice for posting to Usenet, has probably split your
actual markup by inserting a line break at a wrong point, though we cannot
be sure (in the absence of a URL).
Would you please tell me the right construct (clearly must be
functionally equivalent).
Functionally? HTML is about structure and semantics, CSS is about
presentation, so what is "function" here? If you mean presentation, then the
answer is that a table can be rendered in different ways by different
browsers and there is no way create the same rendering without using a
table. If a browser wants to render a table in pink color and another
browser in female voice, how could you you achieve the same effects on each
browser using some CSS?

In reality, the differences between table rendering are relatively small,
but they exist. The following is probably the best "simulation" achievable
in general (since it creates the desired effect on IE with normal settings):

<div style="width: 92px; height: 38px; line-height: 38px; margin:2px;
padding:1px"><span
style="vertical-align: middle;">AnyThing</span></div>
(I have tried with style= and vertical-align, but I get an incorrect
vertical alignment :-( )
You probably didn't notice that by the specifications, vertical-align
applies to inline elements and table cells only. That's why my trickery uses
a <spanelement.

Of course, this was a pointless exercise. You achieve nothing but confusion
this way. Nobody will actually praise you for using clumsy CSS instead of
clumsy CSS. As usual, if you told what you are trying to achieve, in a real
context,...

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Apr 15 '07 #2

P: n/a
On 2007-04-15, pamela fluente <pa***********@libero.itwrote:
>
Hello, for the following code, VS suggests that construct (width=
height= ) is out of date and a newer one
is recommended:

<table><tr><td width="92" height="38" valign="middle">AnyThing</td></
tr></table>
Would you please tell me the right construct (clearly must be
functionally equivalent).
(I have tried with style= and vertical-align, but I get an incorrect
vertical alignment :-( )
It should be <td ... style="vertical-align: middle">. I'm surprised that
doesn't give the same results as valign="middle". What browser are you
using?
Apr 15 '07 #3

P: n/a
On 15 Apr, 16:31, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit pamela fluente:
Hello, for the following code,

As usual, a URL says more than 1,000 bytes of code, especially when the code
has been copied incorrectly, as it usually is.
Sorry, Here is the original

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>

<table>
<tr>
<td width="92" height="38" valign="middle">
AnyThing
</td>
</tr>
</table>

</body>
</html>

>
VS suggests that construct (width=
height= ) is out of date and a newer one
is recommended:

What's VS and why do you care? There's little point in cleaning up clumsy
presentational markup. It's much easier to start afresh, applying good
design principles.
"Warning 1 Validation (XHTML 1.0 Transitional): Attribute 'width' is
considered outdated. A newer construct is recommended.

That's Visual Studio. Very useful (imho) to code without garbage.
>
<table><tr><td width="92" height="38" valign="middle">AnyThing</td></
tr></table>

Google Groups, a poor choice for posting to Usenet, has probably split your
actual markup by inserting a line break at a wrong point, though we cannot
be sure (in the absence of a URL).
Right
>
Would you please tell me the right construct (clearly must be
functionally equivalent).

Functionally? HTML is about structure and semantics, CSS is about
presentation, so what is "function" here? If you mean presentation, then the
answer is that a table can be rendered in different ways by different
browsers and there is no way create the same rendering without using a
table. If a browser wants to render a table in pink color and another
browser in female voice, how could you you achieve the same effects on each
browser using some CSS?
That's philosophically true, but I ma sure you got my point ;-)
>
In reality, the differences between table rendering are relatively small,
but they exist. The following is probably the best "simulation" achievable
in general (since it creates the desired effect on IE with normal settings):

<div style="width: 92px; height: 38px; line-height: 38px; margin:2px;
padding:1px"><span
style="vertical-align: middle;">AnyThing</span></div>
Thank you!
>
(I have tried with style= and vertical-align, but I get an incorrect
vertical alignment :-( )

You probably didn't notice that by the specifications, vertical-align
applies to inline elements and table cells only. That's why my trickery uses
a <spanelement.
You are a genius.

I have seen many people writing neverending articles about vertically
aligning
text within a div (eg, http://www.jakpsatweb.cz/css/css-ver...solution.html).
Where were you?
>
Of course, this was a pointless exercise. You achieve nothing but confusion
this way. Nobody will actually praise you for using clumsy CSS instead of
clumsy CSS. As usual, if you told what you are trying to achieve, in a real
context,...
Very helpful Jukka. It does seem you solved brilliantly my problem.
I will let you know if I get in trouble again !!
>
--
Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
Ciao,

-Pam

PS .

Actually I already found a problem. I need it also work with TOP and
BOTTOM.
But it does NOT seem to work. What am I doing wrong?

example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>

<table>
<tr>
<td width="92" height="38" valign="bottom">
AnyThing
</td>
</tr>
</table>

<br/>
<br/>

<div style="width: 92px; height: 38px; line-height: 38px; margin:2px;
padding:1px"><span style="vertical-align: bottom;">AnyThing</span></
div>

</body>
</html>

Apr 15 '07 #4

P: n/a
On 15 Apr, 19:55, Ben C <spams...@spam.eggswrote:
It should be <td ... style="vertical-align: middle">. I'm surprised that
doesn't give the same results as valign="middle". What browser are you
using?
I think Yucca above answered that ("applies to inline elements and
table cells only.")

-P

Apr 15 '07 #5

P: n/a
Let me provide some background color to show better my problem,
or else you will not notice it on a white page.

Here is the code (watch out line breaks).

What I need is a correct construct which give exactly the same result
as the first one
*whatever* of thee three aligment is used: TOP, MIDDLE, BOTTOM.

I need this because code is generated programmatically and the
alignment can vary.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>

<table style=" background-color: Aqua" >
<tr>
<td width="92" height="38" valign="bottom">
AnyThing
</td>
</tr>
</table>

<br/>
<br/>

<div style=" background-color: Aqua ; width: 92px; height: 38px; line-
height: 38px; margin:2px;
padding:1px"><span style="vertical-align: bottom;">AnyThing</span></
div>

</body>
</html>
Thanks you for any help

-Pam
Apr 15 '07 #6

P: n/a
pamela fluente wrote:
>
Here is the code (watch out line breaks).
Please upload the code to a publicly accessible web server, then post
the URL. Don't post code.

--
Berg
Apr 15 '07 #7

P: n/a
On 15 Apr, 23:04, Bergamot <berga...@visi.comwrote:

Right now I do not have access to a web server: I am working from
home.

The code is simply all that I posted: there is nothing else more. I
just need a correct way of aligning vertically (in the 3 possible
ways)
the text within that box. That's it.

Any CSS guru here can suggest how?

Thank you.

-P

Apr 15 '07 #8

P: n/a
pamela fluente wrote:
On 15 Apr, 23:04, Bergamot <berga...@visi.comwrote:

Right now I do not have access to a web server: I am working from
home.
Sorry, that's no excuse. If your domain isn't publicly accessible, there
are plenty of other places you can put up a test web page. Many ISPs
give their users some free space, plus there are free servers like
yahoo/geocities if all else fails.
The code is simply all that I posted: there is nothing else more.
That's not really the point, you know. Make it easy for people to help
you and you'll get a better response. Posting a URL is the way. Posting
code is not.

If you won't make the effort, why should you expect us to?

--
Berg
Apr 15 '07 #9

P: n/a
pamela fluente wrote :
Hello, for the following code, VS suggests that construct (width=
height= ) is out of date

What's VS?

and a newer one
is recommended:

<table><tr><td width="92" height="38" valign="middle">AnyThing</td></
tr></table>
valign is a deprecated attribute.
If you table cell's content is just a word, then you may be misusing table.
If your table column must be using a specific, defined width, then it
would be proper to define it only once and for the table column.
Same thing with the table cell's height.
If the whole table row height should be 38 pixels, then defining it for
the table row is more useful, helpful than defining it in each table cells.

The default vertical-alignment of data in table cells in all browsers is
middle. So, there is no need whatsoever to define it.

Also, some browsers and some browser versions have bugs on
vertical-alignment in table cells. Here's a convincing testcase which
the MSIE7 fails:

http://www.hixie.ch/tests/adhoc/css/box/table/003.html

Would you please tell me the right construct (clearly must be
functionally equivalent).
It's always preferable to provide an URL showing the problem so that we
can see all of the code. The surrounding code of your chunck pasted
would be available.
(I have tried with style= and vertical-align, but I get an incorrect
vertical alignment :-( )
If you're using table for tabular data, then just post an url
(preferably a reduced testcase).

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Apr 16 '07 #10

P: n/a
On 16 Apr, 01:43, Bergamot <berga...@visi.comwrote:
pamela fluente wrote:
On 15 Apr, 23:04, Bergamot <berga...@visi.comwrote:
Right now I do not have access to a web server: I am working from
home.

Sorry, that's no excuse. If your domain isn't publicly accessible, there
are plenty of other places you can put up a test web page. Many ISPs
give their users some free space, plus there are free servers like
yahoo/geocities if all else fails.
Ok I will. Now it's 3.37 a.m. here and actually I was a little bit
tired to go through
a new registration and website setup. I just hoped I could get some
nice solution before
finally seeing my bed.

Anyway the page will be exactly equal to the few lines I posted here.

Thanks anyway for the patience.

-Pam
>
The code is simply all that I posted: there is nothing else more.

That's not really the point, you know. Make it easy for people to help
you and you'll get a better response. Posting a URL is the way. Posting
code is not.

If you won't make the effort, why should you expect us to?

--
Berg

Apr 16 '07 #11

P: n/a
On 16 Apr, 02:40, Gérard Talbot <newsblahgr...@gtalbot.orgwrote:
pamela fluente wrote :
Hello, for the following code, VS suggests that construct (width=
height= ) is out of date

What's VS?
see my reply above. It's Visual Studio.
If you table cell's content is just a word, then you may be misusing table.
If your table column must be using a specific, defined width, then it
would be proper to define it only once and for the table column.
Same thing with the table cell's height.
If the whole table row height should be 38 pixels, then defining it for
the table row is more useful, helpful than defining it in each table cells.
I am generating random cells with random alignment (top, middle,
bottom).
My code is just that I posted; there is no other code. I just need it
to work
with 3 type of vertical alignments. That's it.
A plain emulation of a table cell behavior done with correct CSS.

the MSIE7 fails:
I need if to work for FF and MSIE.

Thank you

-P

Apr 16 '07 #12

P: n/a
Scripsit pamela fluente:
Anyway the page will be exactly equal to the few lines I posted here.
You are not going to tell us the _real_ problem, are you?

Those few lines can't be your real page. You are describing a tiny little
corner of a real page, and that way, you are effectively making it
impossible to help you. Playing with such a little piece of code is
pointless, and it is a waste of everyone's time to discuss how to clean up
something so irrelevant. If the table really does what you want, why would
you care about some program's complaint about it.

Surely you are using deprecated attributes. But the whole idea of using a
single-cell table to position some text in a colored box is outdated.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Apr 16 '07 #13

P: n/a
Gérard Talbot wrote:
>
Also, some browsers and some browser versions have bugs on
vertical-alignment in table cells. Here's a convincing testcase which
the MSIE7 fails:

http://www.hixie.ch/tests/adhoc/css/box/table/003.html
FYI, the issue here is not vertical alignment in table cells, it's
styling <col>, which is something else altogether.

BTW, while IE apparently allows <colstyling that it shouldn't, gecko
browsers support almost no <colstyling at all, so they'd ignore just
about any style rules there, not just vertical-align.

--
Berg
Apr 16 '07 #14

P: n/a
On 16 Apr, 06:38, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit pamela fluente:
Anyway the page will be exactly equal to the few lines I posted here.

You are not going to tell us the _real_ problem, are you?
I will tell you the REAL problem . But please try to stick to the
point
if you do not know the answer of this is impossible to do with CSS
just tell me so.
This is NOT a static web page but is an HTML/CSS output created
programmatically.
The user has an interface (EXE application) where there are some
objects he can edit using a GUI.

These objects are basically "boxes" with multiline text inside.

The user can drag the objects as he wish with the mouse and can put
any text in it.

The text can have any alignment: Vertical, Top, Bottom.

I need to create an HTML output of the user design. That is I have to
create
some boxes with text inside to match perfectly what the user
designed..

Basically I have to make 3 kind of boxes:

1
<table style=" background-color: Aqua" >
<tr>
<td width="xx" height="yy" valign="top">
Multiline text
</td>
</tr>
</table>

2

<table style=" background-color: Aqua" >
<tr>
<td width="xx" height="yy" valign="middle">
Multiline text
</td>
</tr>
</table>

3

<table style=" background-color: Aqua" >
<tr>
<td width="xx" height="yy" valign="bottom">
Multiline text
</td>
</tr>
</table>

where xx, yy are any number.

This is perfectly fine (because it can match perfectley the user's
design).

HOWEVER. If there is a more correct way to have the *SAME* visual
result on MSIE and FF using correct CSS instead of those 3 clumsy
constructs, I will be happy.

All I need is the precise replacement for the above 3 king of boxes,
done with
correct CSS, to work with MSIE and FF. That's it. As simple as that.

Can you just do this simple tyny thing with CSS ? If not, don't be
afraid to tell me so.

If yes please just give the code first. Then we can discuss forever on
it.

Thanks,

Pam

Apr 16 '07 #15

P: n/a
On 2007-04-16, pamela fluente <pa***********@libero.itwrote:
[...]
Basically I have to make 3 kind of boxes:

1
<table style=" background-color: Aqua" >
<tr>
<td width="xx" height="yy" valign="top">
Multiline text
</td>
</tr>
</table>

2

<table style=" background-color: Aqua" >
<tr>
<td width="xx" height="yy" valign="middle">
Multiline text
</td>
</tr>
</table>

3

<table style=" background-color: Aqua" >
<tr>
<td width="xx" height="yy" valign="bottom">
Multiline text
</td>
</tr>
</table>

where xx, yy are any number.

This is perfectly fine (because it can match perfectley the user's
design).

HOWEVER. If there is a more correct way to have the *SAME* visual
result on MSIE and FF using correct CSS instead of those 3 clumsy
constructs, I will be happy.

All I need is the precise replacement for the above 3 king of boxes,
done with
correct CSS, to work with MSIE and FF. That's it. As simple as that.

Can you just do this simple tyny thing with CSS ? If not, don't be
afraid to tell me so.
It is possible in CSS using:

1. display: inline-block and setting line-height. Or
2. display: table-cell to do what you're doing anyway but without
<tableelements.

(2) doesn't work in IE, (1) might, but doesn't work in FF.

So realistically, it's not possible other than the way you're doing it.
Apr 16 '07 #16

P: n/a
On 16 Apr, 17:58, Ben C <spams...@spam.eggswrote:
>
Can you just do this simple tyny thing with CSS ? If not, don't be
afraid to tell me so.

It is possible in CSS using:

1. display: inline-block and setting line-height. Or
2. display: table-cell to do what you're doing anyway but without
<tableelements.

(2) doesn't work in IE, (1) might, but doesn't work in FF.

So realistically, it's not possible other than the way you're doing it.-
Hi Ben, Thanks for the straight answer.

I had the suspect that here CSS has some design problem. It seems
incredible they "forgot"
to put this simple functionality in the "language", while almost any
layout seems possible.

Perhaps they understood that one would just use a table element for
these cases. But it's
really ugly (to me) to have to define an entire table just because
one need to vertically align text
in a box.

It's rather disappointing :-( Isn't it?

Let's hope some genius find a smart and elegant solution to that
soon...

-P


Apr 16 '07 #17

P: n/a
pamela fluente wrote:
>
I will tell you the REAL problem . But please try to stick to the
point
Perhaps you don't realize that this is a discussion group, hence we
discuss things here. That includes whether what you want to do is
advisable in the first place. Welcome to Usenet.
The user has an interface (EXE application) where there are some
objects he can edit using a GUI.

These objects are basically "boxes" with multiline text inside.

The user can drag the objects as he wish with the mouse and can put
any text in it.
Sounds like a so-called WYSIWYG web authoring tool. I have visions of
absolutely positioned text elements scattered all over the page, which
overlap other elements when there is the slightest variation in the
user's text size. :-(
<td width="xx" height="yy" valign="top">
Multiline text
</td>
<td width="xx" height="yy" valign="middle">
Multiline text
</td>
<td width="xx" height="yy" valign="bottom">
Multiline text
</td>

where xx, yy are any number.

This is perfectly fine (because it can match perfectley the user's
design).
Whether it matches the user's design perfectly isn't important. Whether
the resulting web page is usable by the target audience is.
HOWEVER. If there is a more correct way to have the *SAME* visual
result on MSIE and FF using correct CSS instead of those 3 clumsy
constructs, I will be happy.
Ben gave you some suggestions for replacing tables, but they aren't
really viable alternatives. Regardless, setting precise height and width
on text blocks is a bad idea, especially if setting dimensions in px,
which I'm sure you are doing. At least with table markup, those
dimensions are treated as minimums and the cell will expand if need be.
I still have visions of these boxes absolutely positioned in a fragile
layout.

The whole idea sounds flawed to me, but you haven't really given us the
whole picture, so I could be overly pessimistic. Tell me I'm wrong, please.
Can you just do this simple tyny thing with CSS ? If not, don't be
afraid to tell me so.
I would bet that Visual Studio isn't really very bright, but it appeared
to be clever by telling you there is a more modern way to code something.
If yes please just give the code first. Then we can discuss forever on
it.
You might as well stick with what you have. The only usable alternative
is dropping the width, height and valign attributes and using inline
styles instead. That doesn't really buy you much. The output will still
be guaranteed usable (more or less) only by the person who designed it.

Unless my guesses about the app are all wrong, that is.

--
Berg
Apr 16 '07 #18

P: n/a
On 2007-04-16, pamela fluente <pa***********@libero.itwrote:
On 16 Apr, 17:58, Ben C <spams...@spam.eggswrote:
>>
Can you just do this simple tyny thing with CSS ? If not, don't be
afraid to tell me so.

It is possible in CSS using:

1. display: inline-block and setting line-height. Or
2. display: table-cell to do what you're doing anyway but without
<tableelements.

(2) doesn't work in IE, (1) might, but doesn't work in FF.

So realistically, it's not possible other than the way you're doing it.-

Hi Ben, Thanks for the straight answer.

I had the suspect that here CSS has some design problem. It seems
incredible they "forgot"
to put this simple functionality in the "language", while almost any
layout seems possible.
Well the functionality is there though, it's just that IE and FF
"forgot" to implement it all properly :)
Apr 16 '07 #19

P: n/a
On 16 Apr, 20:10, Bergamot <berga...@visi.comwrote:
Perhaps you don't realize that this is a discussion group, hence we
discuss things here. That includes whether what you want to do is
advisable in the first place. Welcome to Usenet.
thanks :-)
Sounds like a so-called WYSIWYG web authoring tool. I have visions of
absolutely positioned text elements scattered all over the page, which
overlap other elements when there is the slightest variation in the
user's text size. :-(
Yes similar. But it's not meant to make web pages. Web pages are
considered
an "export" and they are supposed to reflect strictly the uder design.
Whether it matches the user's design perfectly isn't important. Whether
the resulting web page is usable by the target audience is.
In my case actually strict adherence is a wanted quality of the
"export".
Ben gave you some suggestions for replacing tables, but they aren't
really viable alternatives. Regardless, setting precise height and width
on text blocks is a bad idea, especially if setting dimensions in px,
which I'm sure you are doing. At least with table markup, those
dimensions are treated as minimums and the cell will expand if need be.
I still have visions of these boxes absolutely positioned in a fragile
layout.
yes
>
The whole idea sounds flawed to me, but you haven't really given us the
whole picture, so I could be overly pessimistic. Tell me I'm wrong, please.
See it as an export of something else. Not like a masterpiece web
page.
It's an export that must be as close as possible to the original
work ,
which may be exported also in other format such as PDF. And all export
must look equal to the original.
I would bet that Visual Studio isn't really very bright, but it appeared
to be clever by telling you there is a more modern way to code something.
I will vote for VS as the best piece of software ever.
You might as well stick with what you have. The only usable alternative
is dropping the width, height and valign attributes and using inline
styles instead. That doesn't really buy you much. The output will still
be guaranteed usable (more or less) only by the person who designed it.
Let's do that. I am not sure what you mean. I tried

<table style=" background-color: Aqua" >
<tr>
<td style="width:92; height:38" valign="top">
AnyThing
</td>
</tr>
</table>
but it does not seem to give the same result as

<table style=" background-color: Aqua" >
<tr>
<td width="92" height="38" valign="top">
AnyThing
</td>
</tr>
</table>

Could you clarify what you mean with the right code?
>
Unless my guesses about the app are all wrong, that is.
Nope. They are quite right.
>
--
Berg
Thank you Berg,

-Pam

Apr 16 '07 #20

P: n/a
On 16 Apr, 20:16, Ben C <spams...@spam.eggswrote:
On 2007-04-16, pamela fluente <pamelaflue...@libero.itwrote:


On 16 Apr, 17:58, Ben C <spams...@spam.eggswrote:
Can you just do this simple tyny thing with CSS ? If not, don't be
afraid to tell me so.
It is possible in CSS using:
1. display: inline-block and setting line-height. Or
2. display: table-cell to do what you're doing anyway but without
<tableelements.
(2) doesn't work in IE, (1) might, but doesn't work in FF.
So realistically, it's not possible other than the way you're doing it.-
Hi Ben, Thanks for the straight answer.
I had the suspect that here CSS has some design problem. It seems
incredible they "forgot"
to put this simple functionality in the "language", while almost any
layout seems possible.

Well the functionality is there though, it's just that IE and FF
"forgot" to implement it all properly :)- Nascondi testo tra virgolette -
Ah Really? Too bad.

What would be the functionality that has not been implemented ? And
why they both skipped this fundamental one?
Did the spec deliver too late?

-P

Apr 16 '07 #21

P: n/a
On 16 Apr, 21:34, "pamela fluente" <pamelaflue...@libero.itwrote:
On 16 Apr, 20:10, Bergamot <berga...@visi.comwrote:
>
Could you clarify what you mean with the right code?
Ah ok. I spot the error. Didn't specify the unit. Evidently it does
not assume px.

-P
>

Thank you Berg,

-Pam

Apr 16 '07 #22

P: n/a
pamela fluente wrote:
On 16 Apr, 20:10, Bergamot <berga...@visi.comwrote:
>Whether it matches the user's design perfectly isn't important. Whether
the resulting web page is usable by the target audience is.

may be exported also in other format such as PDF. And all export
must look equal to the original.
Now it really sounds flawed. Web media is different from PDF or other
print media. Looking "equal" isn't really part of the equation, you just
don't realize it.
>You might as well stick with what you have. The only usable alternative
is dropping the width, height and valign attributes and using inline
styles instead.

Let's do that. I am not sure what you mean. I tried
<td style="width:92; height:38" valign="top">
You already figured out you need units on a non-zero value, but also
drop attribute valign for CSS property vertical-align.
>Unless my guesses about the app are all wrong, that is.

Nope. They are quite right.
As I feared. :(

--
Berg
Apr 16 '07 #23

P: n/a
On 16 Apr, 22:35, Bergamot <berga...@visi.comwrote:
pamela fluente wrote:
On 16 Apr, 20:10, Bergamot <berga...@visi.comwrote:

Now it really sounds flawed. Web media is different from PDF or other
print media. Looking "equal" isn't really part of the equation, you just
don't realize it.
Well in my case I have to make compromises. A page can have a lot
(thousands)
of objects each one depending on the position of many other ones.
And actually an objective of the whole export is to be exactly equal
to the original.
I cannot allow object to freely move because otherwise all the
assembly
effect is going to be sboiled.
I know you do not want to hear that, but it's a "pixel precision"
composition.
Every object is fixed in the position where the user put it at design
time. To change
it, he can "redesign" the original.

Not quite a web page, as you intend it :-)
>
You already figured out you need units on a non-zero value, but also
drop attribute valign for CSS property vertical-align.
ah thanks, perfect:

<table style=" background-color: Aqua" >
<tr>
<td style="width:92px; height:38px; vertical-align:top">
AnyThing
</td>
</tr>
</table>

It's still quite ugly, but at least I do not have the warnings !

Another reason why I was looking for alternative syntax is that the
above is quite
redundant for just a box (or a "cell"). Each <td></tdcalls for a
<tableand <tr>
so there is a lot of overhead. And I might have thousands of those
boxes on a document...

Really ugly, but there seems to be no other choice. Because each box
can be positioned independently.
-P
Apr 16 '07 #24

P: n/a
On 2007-04-16, pamela fluente <pa***********@libero.itwrote:
On 16 Apr, 20:16, Ben C <spams...@spam.eggswrote:
>On 2007-04-16, pamela fluente <pamelaflue...@libero.itwrote:


On 16 Apr, 17:58, Ben C <spams...@spam.eggswrote:
Can you just do this simple tyny thing with CSS ? If not, don't be
afraid to tell me so.
>It is possible in CSS using:
>1. display: inline-block and setting line-height. Or
2. display: table-cell to do what you're doing anyway but without
<tableelements.
>(2) doesn't work in IE, (1) might, but doesn't work in FF.
>So realistically, it's not possible other than the way you're doing it.-
Hi Ben, Thanks for the straight answer.
I had the suspect that here CSS has some design problem. It seems
incredible they "forgot"
to put this simple functionality in the "language", while almost any
layout seems possible.

Well the functionality is there though, it's just that IE and FF
"forgot" to implement it all properly :)- Nascondi testo tra virgolette -

Ah Really? Too bad.

What would be the functionality that has not been implemented ?
display: inline-block and display: table, display: table-cell, etc.
And why they both skipped this fundamental one?
I don't know why Firefox skipped inline-block as it is so useful (for
lots of other things, it's not the best way to do this particular one,
tables are better). As for Microsoft they don't give the impression that
they particularly aim to be useful anyway.
Apr 16 '07 #25

P: n/a
pamela fluente wrote:
>
I know you do not want to hear that, but it's a "pixel precision"
composition.
Which means that HTML is the wrong tool for the job.

--
Berg
Apr 16 '07 #26

P: n/a
Scripsit pamela fluente:
>You are not going to tell us the _real_ problem, are you?

I will tell you the REAL problem . But please try to stick to the
point
if you do not know the answer of this is impossible to do with CSS
just tell me so.
I don't like your tone of voice, and I still haven't seen your URL.

I have already given you the CSS answer, to the extent that your question
was about CSS (in the most obvious way: in achieving in "pure CSS" the
visual impression that you seem to be aiming at using a layout table).
If yes please just give the code first. Then we can discuss forever on
it.
There's little point in discussing when you're asking wrong questions and
don't even understand the answers to them.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Apr 17 '07 #27

P: n/a
Bergamot wrote :
Gérard Talbot wrote:
>Also, some browsers and some browser versions have bugs on
vertical-alignment in table cells. Here's a convincing testcase which
the MSIE7 fails:

http://www.hixie.ch/tests/adhoc/css/box/table/003.html

FYI, the issue here is not vertical alignment in table cells,
Indirectly, yes.
"<title>CSS table model: vertical-align on columns (shouldn't do
anything)</title>"
it's
styling <col>, which is something else altogether.
If vertical-align should not apply to <colelements ...
>
BTW, while IE apparently allows <colstyling that it shouldn't,
Correct.

gecko
browsers support almost no <colstyling at all
Well, it does not support (and it shouldn't) vertical-align css
declaration on <col>.

vertical-align Applies to: inline-level and 'table-cell' elements
according to latest CSS 2.1 spec:
http://www.w3.org/TR/2006/WD-CSS21-2...vertical-align

, so they'd ignore just
about any style rules there, not just vertical-align.
What remains afterwards should be the default vertical-align value for
each table cells. For table cells, that is middle.
The default vertical-alignment of data in table cells in all browsers is middle.
was in my original post.

thead, tbody,
tfoot { vertical-align: middle }
td, th { vertical-align: inherit }
Default style sheet for HTML 4 (informative, not normative, I must say..)
http://www.w3.org/TR/2006/WD-CSS21-20061106/sample.html

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Apr 18 '07 #28

This discussion thread is closed

Replies have been disabled for this discussion.