HighDots Forums  

Floating table row

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss Floating table row in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Allie
 
Posts: n/a

Default Floating table row - 12-06-2007 , 03:06 PM






Here's an example of what I'm trying to do:

<table>
<tr style="text-align:left; font-size:10pt; font-weight:bold">
<!-- I want this word to align to the left -->
' ||CRPT|| '
<!-- I want this link to align to the right -->
<A HREF=" REPORT?v_rpt='|| v_rpt
Quote:
|'&v_printable=1'||'">Printable</A
/tr
</table>

I thought that the first row would be aligned left, and the second row
would float on top of it to the right.

Instead, there are two rows aligned to the left. Now, I'm wondering if
using "float" is the way to go about this.


Reply With Quote
  #2  
Old   
Allie
 
Posts: n/a

Default Re: Floating table row - 12-06-2007 , 03:11 PM






On Dec 6, 1:06 pm, Allie <arcrev... (AT) gmail (DOT) com> wrote:
Quote:
Here's an example of what I'm trying to do:

table
tr style="text-align:left; font-size:10pt; font-weight:bold"
!-- I want this word to align to the left --
' ||CRPT|| '
!-- I want this link to align to the right --
A HREF=" REPORT?v_rpt='|| v_rpt
||'&v_printable=1'||'">Printable</A
/tr
/table

I thought that the first row would be aligned left, and the second row
would float on top of it to the right.

Instead, there are two rows aligned to the left. Now, I'm wondering if
using "float" is the way to go about this.
whoops, "float: right;" goes right before the "text-align: left;"
above. That's what I meant to put in the first post.



Reply With Quote
  #3  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Floating table row - 12-06-2007 , 03:25 PM



Allie wrote:
Quote:
Here's an example of what I'm trying to do:

table
tr style="text-align:left; font-size:10pt; font-weight:bold"
!-- I want this word to align to the left --
' ||CRPT|| '
!-- I want this link to align to the right --
A HREF=" REPORT?v_rpt='|| v_rpt
||'&v_printable=1'||'">Printable</A
/tr
/table

I thought that the first row would be aligned left, and the second row
would float on top of it to the right.
1. Where do you see two rows? You have only one.

2. A TR can't contain text. It can only contain TDs and THs.


Reply With Quote
  #4  
Old   
Allie
 
Posts: n/a

Default Re: Floating table row - 12-06-2007 , 03:35 PM



On Dec 6, 1:25 pm, Harlan Messinger
<hmessinger.removet... (AT) comcast (DOT) net> wrote:
Quote:
Allie wrote:
Here's an example of what I'm trying to do:

table
tr style="text-align:left; font-size:10pt; font-weight:bold"
!-- I want this word to align to the left --
' ||CRPT|| '
!-- I want this link to align to the right --
A HREF=" REPORT?v_rpt='|| v_rpt
||'&v_printable=1'||'">Printable</A
/tr
/table

I thought that the first row would be aligned left, and the second row
would float on top of it to the right.

1. Where do you see two rows? You have only one.

2. A TR can't contain text. It can only contain TDs and THs.
okay. sorry for the confusion. here we go:
<tr>
<p align="left">
' ||CRPT|| '
</p>
</tr>
<tr>
<p style="float:right>
&nbsp;<A HREF=" REPORT?v_rpt='|| v_rpt
Quote:
|'&v_printable=1'||'">Printable</A
/p
</tr>


Reply With Quote
  #5  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: Floating table row - 12-06-2007 , 03:48 PM



Allie wrote:
Quote:
On Dec 6, 1:25 pm, Harlan Messinger
hmessinger.removet... (AT) comcast (DOT) net> wrote:
Allie wrote:
Here's an example of what I'm trying to do:
table
tr style="text-align:left; font-size:10pt; font-weight:bold"
!-- I want this word to align to the left --
' ||CRPT|| '
!-- I want this link to align to the right --
A HREF=" REPORT?v_rpt='|| v_rpt
||'&v_printable=1'||'">Printable</A
/tr
/table
I thought that the first row would be aligned left, and the second row
would float on top of it to the right.
1. Where do you see two rows? You have only one.

2. A TR can't contain text. It can only contain TDs and THs.

okay. sorry for the confusion. here we go:
tr
p align="left"
' ||CRPT|| '
/p
/tr
tr
p style="float:right
&nbsp;<A HREF=" REPORT?v_rpt='|| v_rpt
||'&v_printable=1'||'">Printable</A
/p
/tr
Still no TDs.

Why are you using the HTML align attribute in one place and a float in
the other? The CSS attribute for text alignment is text-align.


Reply With Quote
  #6  
Old   
John Hosking
 
Posts: n/a

Default Re: Floating table row - 12-06-2007 , 03:49 PM



Allie wrote:
Quote:
On Dec 6, 1:25 pm, Harlan Messinger
hmessinger.removet... (AT) comcast (DOT) net> wrote:


2. A TR can't contain text. It can only contain TDs and THs.

okay. sorry for the confusion. here we go:
tr
p align="left"
' ||CRPT|| '
/p
/tr
tr
p style="float:right
&nbsp;<A HREF=" REPORT?v_rpt='|| v_rpt
||'&v_printable=1'||'">Printable</A
/p
/tr
I notice this is considerably different from your first post and its
amended version. This is (one reason) why we prefer a URL to pasted code.

What motivatition would people have to reply constructively to you if
you don't read the replies you get?

Beyond which, that's one wacky-looking URL in the HREF. Makes me think
you're plugging the URL string directly into a DB query. But editing
URLs is trivially easy, so I wonder how secure your site is.

--
John
Pondering the value of the UIP: http://improve-usenet.org/


Reply With Quote
  #7  
Old   
Allie
 
Posts: n/a

Default Re: Floating table row - 12-06-2007 , 05:54 PM



On Dec 6, 1:49 pm, John Hosking <J... (AT) DELETE (DOT) Hosking.name.INVALID>
wrote:
Quote:
Allie wrote:
On Dec 6, 1:25 pm, Harlan Messinger
hmessinger.removet... (AT) comcast (DOT) net> wrote:

2. A TR can't contain text. It can only contain TDs and THs.

okay. sorry for the confusion. here we go:
tr
p align="left"
' ||CRPT|| '
/p
/tr
tr
p style="float:right
&nbsp;<A HREF=" REPORT?v_rpt='|| v_rpt
||'&v_printable=1'||'">Printable</A
/p
/tr

I notice this is considerably different from your first post and its
amended version. This is (one reason) why we prefer a URL to pasted code.

What motivatition would people have to reply constructively to you if
you don't read the replies you get?

Beyond which, that's one wacky-looking URL in the HREF. Makes me think
you're plugging the URL string directly into a DB query. But editing
URLs is trivially easy, so I wonder how secure your site is.

--
John
Pondering the value of the UIP:http://improve-usenet.org/
I didn't want to copy-paste because I thought that I would try to
truncate it so there was less code in my question. Yeah, that was a
bad decision. Anyway, moving on... someone told me that what I wanted
to do to solve my problem was use float to the right and align to the
left. That's all I was able to get from him. I created this message to
hopefully get some help, because I have very little html experience.
Anyway, after messing around with it, i think that I'll just use 2
different rows. As far as my wacky-looking URL, it seems that well
thought out IF-ELSE clauses will keep the site secure.

Allie


Reply With Quote
  #8  
Old   
GTalbot
 
Posts: n/a

Default Re: Floating table row - 12-07-2007 , 11:52 PM



On 6 déc, 18:54, Allie <arcrev... (AT) gmail (DOT) com> wrote:

Quote:
someone told me that what I wanted
to do to solve my problem was use float to the right and align to the
left.
If you read carefully the CSS 2.x specification, you'll see that
floating a
table row is either formally discouraged or its effect can not be
defined.

Quote:
That's all I was able to get from him. I created this message to
hopefully get some help, because I have very little html experience.
Anyway, after messing around with it, i think that I'll just use 2
different rows.
Chances are you are misusing tables for layout purposes anyway.
Tables
should be used for tabular data only, not for positioning content.

CSS page templates:
http://www.gtalbot.org/NvuSection/Nv...bpageTemplates

Table-based webpage design versus CSS-based webpage design: resources,
explanations and tutorials:
http://www.gtalbot.org/NvuSection/Nv...CSSDesign.html

Gérard


Reply With Quote
  #9  
Old   
Ben C
 
Posts: n/a

Default Re: Floating table row - 12-08-2007 , 03:19 AM



On 2007-12-08, GTalbot <newsgroup (AT) gtalbot (DOT) org> wrote:
Quote:
On 6 déc, 18:54, Allie <arcrev... (AT) gmail (DOT) com> wrote:

someone told me that what I wanted
to do to solve my problem was use float to the right and align to the
left.

If you read carefully the CSS 2.x specification, you'll see that
floating a
table row is either formally discouraged or its effect can not be
defined.
I think it is well-defined, it's just not quite what people expect.

If you float a table row, it becomes a block (see CSS 2.1 9.7). That
means you have a block directly inside a table, and table cells directly
inside a block, both of which result in the generation of anonymous
table boxes (see CSS 2.1 17.2.1).

So if you started with this:

table
row
cell cell
row
cell cell

and you float the first row, you should get this:

table
row*
cell*
floated block
table*
row*
cell cell
row
cell cell

Where * denotes an anonymous table, table-row or table-cell box.

In most cases the result will actually look very similar anyway. And
you're right it's not recommended.

There is a Note at the bottom of CSS 2.1:

C.3.29 17.5 Visual layout of table contents

The following note:

Note. Table cells may be relatively and absolutely positioned,
but this is not recommended: positioning and floating remove a
box from the flow, affecting table alignment.

has been amended as follows:

Note. Table cells may be positioned, but this is not
recommended: absolute and fixed positioning, as well as
floating, remove a box from the flow, affecting table size.

The amendment of course is to remove relative positioning, which is
harmless and quite useful to do on a table cell to turn it into a
containing block for positioned contents. Unfortunately that _only_
works in IE, and not in FF, Opera or Konqueror. See
http://www.tidraso.co.uk/misc/td-alignment.html.


Reply With Quote
  #10  
Old   
Roderik
 
Posts: n/a

Default Re: Floating table row - 12-08-2007 , 12:31 PM



Allie schreef:
Quote:
Here's an example of what I'm trying to do:

table
tr style="text-align:left; font-size:10pt; font-weight:bold"
!-- I want this word to align to the left --
' ||CRPT|| '
!-- I want this link to align to the right --
A HREF=" REPORT?v_rpt='|| v_rpt
||'&v_printable=1'||'">Printable</A
/tr
/table

I thought that the first row would be aligned left, and the second row
would float on top of it to the right.

Instead, there are two rows aligned to the left. Now, I'm wondering if
using "float" is the way to go about this.
<!-- I want this link to align to the right -->
<div style="float:right"><A HREF=" REPORT?v_rpt='||
v_rpt||'&v_printable=1'||'">Printable</A></div>
<!-- I want this word to align to the left -->
' ||CRPT|| '

And remove the table. Assign the font settings to the containing element.

--
http://www.roderik.net/nieuws/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.