Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-19 21:18:53

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Is valign valid on tr elements?

From this thread:

Can style="vertical-align:..." be applied to a <tr> element? Is it valid?


Alex

Offline

#2 2006-01-19 23:31:19

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Is valign valid on tr elements?

CSS2 Reference: 17.5.3 Table height algorithms

table cells maybe… but I think I’ll duck out now… c’mon Jeremie, one for you : )

Offline

#3 2006-01-20 00:04:26

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Is valign valid on tr elements?

Seems to be. I posted this code into the W3C validator and got green lights:

<pre>
&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”&gt;

&lt;html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“en” lang=“en”&gt;

&lt;head&gt; &lt;meta http-equiv=“content-type” content=“text/html;charset=UTF-8” /&gt; &lt;title>sample&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;table&gt; &lt;tr style=“vertical-align:top”&gt; &lt;td&gt;Content&lt;/td&gt; &lt;/tr&gt;
&lt;/table&gt;

&lt;/body&gt;

&lt;/html&gt;
</pre>

Another place I check for HTML and CSS information is htmldog.com

Last edited by jdykast (2006-01-20 00:07:13)

Offline

#4 2006-01-20 00:08:56

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Is valign valid on tr elements?

I’ve seen this already, but every mention of vertical alignment seems to relate to cells only.


Alex

Offline

#5 2006-01-20 00:17:01

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Is valign valid on tr elements?

I didn’t spend the time to wade through the documentation you listed but the following validates using the W3C CSS validator:

<code>tr {vertical-align: top;}</code>

Offline

#6 2006-01-20 00:47:21

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Is valign valid on tr elements?

The ‘vertical-align’ property of each table cell determines its alignment within the row.

which is similar to the use of vertical-align outside of table cells, i.e. it doesn’t set the vertical positioning within the element, but the vertical positioning of the element within its parent element…

can’t really see how rows can be vertically-aligned to the table itself?

maybe it validates but…

Offline

#7 2006-01-20 01:09:18

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Is valign valid on tr elements?

Put it this way: does it make any sense for this Textile:

^. |a|b|c|

..to produce this?:

<table><tr style="vertical-align:top;"><td><a></td>...</table>

Alex

Offline

#8 2006-01-20 02:01:18

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Is valign valid on tr elements?

zem wrote:
Can style="vertical-align:..." be applied to a <tr> element? Is it valid?

The vertical-align property can be applied to inline element and table cell. So the short answer is no, it’s not legal.

In the Textile context, what it should output is :

<table><tr><td style="vertical-align:top;"><a></td>...</table>

Last edited by Jeremie (2006-01-20 02:04:02)

Offline

#9 2006-01-20 07:00:50

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,261
Website

Re: Is valign valid on tr elements?

To add to jeremies reply, the vertical-align property doesn’t inherit, so applying it to a < tr > won’t work, ever, in a decent browser in standards compliant mode.

BTW, Zem, when you look up documentation on CSS properties, you better check the CSS 2.1 documents, as those are much closer to the real world. The CSS 2.0 docs are a huge collection of contradictions, impossibilities and more.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB