Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TABLE tag behavior 2

Status
Not open for further replies.

cfFran

Programmer
May 30, 2002
64
US
We have observed a strange behavior of the HTML <TABLE> tag. If the ColdFusion module
does not specify the ALIGN=&quot;alignmentSpec&quot; attribute for the tag, everything displays
as expected. Most specifically, the ColdFusion debug information is under the table.

If I specify &quot;LEFT&quot; or &quot;RIGHT&quot; for the ALIGN attribute, the ColdFusion debug information
is displayed to the opposite side of the table. For example, ALIGN=&quot;LEFT&quot; causes the
debug info to be displayed to the right of the table. In order to make the display
look normal, I had to put in a number of <BR> tags -- Generally, as many as there are
lines of data displayed in the table.

This was tested for Internet Explorer 6.0 and Netscape 4.8 and 7.1 browsers. The same
results were observed.

Does anyone have an answer for this behavior?

Thanks,
Fran
 
For tables, align refers to the position...

If you're trying to center right align text in the table.. remove the align attribute and set:

style=&quot;text-align: right&quot;

as an attribute of the tag. This is not coldfusion, this is html.. if you were to wrap it in a surrounding table that had no align attribute it would display the way you wanted though.

Tony

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
As you suggest the ALIGN attribute is for the table not the cells within the table. We are not having any difficulty in left or right aligning text inside a cell. The troubling behavior is in the second table on a page displaying to the left or right of the master table (that includes ColdFusion debug information) rather than under it. I just wondered if anyone knew why this happens. It really does make an ugly display. Generally, the debug information will write over top of the master table as well.

What determines whether two tables are rendered side by side or one under the other in the browser?
 
The align attribute, its mostly for aligin text outside of tables.. works the same way with pictures and such.. if you want the debug table below the other table then take align attributes out of both, if you want them side by side, use a master table with two cells.

Bluntly the problem is the align attribute, it does not work well with other content on the page.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
&quot;does not work well&quot;?

sounds to me that the align attribute is working perfectly

it is intended to allow stuff to flow around it

it implements a float

if you don't want anything beside the floated table, use

<br clear=&quot;all&quot;>

or the css-friendly

<br style=&quot;clear:all&quot; />

immediately after it

rudy
SQL Consulting
 
My apologies guys. If I had known enough to read the HTML standard on Floating Objects, I wouldn't have taken up your time. Thanks for the information.

I did try the variations of the <BR> tag suggested by Rudy. The first worked in all browsers. However, the second variation <br style=&quot;clear:all&quot;/> only worked in IE 6.0. It failed to work in Netscape 4.8 and 7.1.

Bottom Line for me: Don't use the align=&quot;left&quot; attribute.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top