473,378 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Floating table row

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.
Dec 6 '07 #1
7 15644
On Dec 6, 1:06 pm, Allie <arcrev...@gmail.comwrote:
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.

Dec 6 '07 #2
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.
Dec 6 '07 #3
On Dec 6, 1:25 pm, Harlan Messinger
<hmessinger.removet...@comcast.netwrote:
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>
Dec 6 '07 #4
Allie wrote:
On Dec 6, 1:25 pm, Harlan Messinger
<hmessinger.removet...@comcast.netwrote:
>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.
Dec 6 '07 #5
On 6 déc, 18:54, Allie <arcrev...@gmail.comwrote:
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.
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
Dec 8 '07 #6
On 2007-12-08, GTalbot <ne*******@gtalbot.orgwrote:
On 6 déc, 18:54, Allie <arcrev...@gmail.comwrote:
>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.
Dec 8 '07 #7
Allie schreef:
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/
Dec 8 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JHR | last post by:
Hey all, I'm trying to make a sidebar box float to the right of various items, and for those items to wrap if a user shrinks his browser window. Instead, in every browser I've tried except for...
11
by: Stephen Poley | last post by:
I'd like to float an image to the bottom of a DIV containing several paragraphs, so that it is positioned to the right of the closing paragraphs (and preferably below the closing paragraphs if the...
10
by: NoSpan | last post by:
I have this page that has layout like the following: (no frameset) ---------------------------------------- | header | |--------------------------------------| | ...
1
by: patelbrijeshn | last post by:
Hi , I want to display a huge table. So I want to make the table header visible on the screen even as the user scrolls the window. I am using div tag to create the floating table header. Here is...
5
by: rocknbil | last post by:
Hello everyone! I'm new here but have been programming for the web in various languages for 15 years or so. I'm certainly no "expert" but can keep myself out of trouble (or in it?) most of the time....
4
by: tbirnseth | last post by:
I'm having trouble between IE and FF. For once, IE behaves as I would expect, but FF doesn't. Basically I have a container with two floating DIVs in it. One floats left and the other right. I then...
5
by: jemcgui | last post by:
I've been building a site that has a quirk in it. It will display just as intended in IE but not firefox. The left "nav" div which is floating left will be forced down to the bottom of the page. The...
14
by: Peter Sprenger | last post by:
Hello, I want to efficient convert floating point numbers (IEEE754) into a string. I have no library routines that do the job (like sprintf etc.), because I work in an embedded environment. ...
6
by: Massa Batheli | last post by:
sql server 2000 sp4 build 2184 runs stats with maintenance plan sp_msforeachtable stored procedure updating full stats for each table and the results are identical A floating point...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.