Closed Bug 297733 Opened 20 years ago Closed 19 years ago

Bad layout for DataGrid caption align left

Categories

(Core :: Layout, defect)

1.7 Branch
x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: artifex7-firefoxbugzilla, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511

Using a DataGrid caption with left align, e.g.,

<asp:DataGrid id="dgrTestGrid"
style="z-index: 37; position: absolute; left: 16px; top: 488px; width: 865px;
height: 32px"
runat="server" CssClass="Text" AutoGenerateColumns="False" BorderWidth="3px"
Caption="Caption Text" CaptionAlign="Left" SortExpr="" TabIndex="24">
<HeaderStyle .... etc.

Firefox 1.0.4 renders it to the left of the DataGrid like this:

        +------
        | Header row
Caption | Item row
 Text   | Item row
       etc.

But IE 6.0sp2 and Opera 7.5 render it like this (this is the desired layout):

  Caption Text
 +------
 | Header row
 | Item row
 | Item row
etc.


Reproducible: Always

Steps to Reproduce:
1. Create a .aspx page with a DataGrid with a left-align caption as listed in
"Details".

Actual Results:  
Described in "Details"

Expected Results:  
Described in "Details"

Duplicated in Firefox 1.0.4; Firefox nightly build of 14-Jun-05; Mozilla 1.7.8.
Mozilla nightly build of 14-Jun-05 would not launch on my WinXPsp2 PC.
Please post a URL to a site showing the problem.  There's really not much I can
do with this otherwise.
==> layout
Assignee: general → nobody
Component: General → Layout
Product: Mozilla Application Suite → Core
QA Contact: general → layout
Version: unspecified → 1.7 Branch
(In reply to comment #1)
> Please post a URL to a site showing the problem.  There's really not much I can
> do with this otherwise.
This problem occurred with a website under development and not yet available on
the internet. A short sample of the ASP.NET code was included in the original
problem description. Here is a more complete version:

<%@ Page Language="c#" AutoEventWireup="true" Codefile="..\ActionRun.aspx.cs"
Inherits="TZ.ActionRun" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<!-- From Styles.css:

.Text
{
  font-weight: normal;
  font-size: 12pt;
  word-spacing: normal;
  text-transform: none;
  color: black;
  font-family: Tahoma, sans-serif;
  letter-spacing: normal;
  text-decoration: none;
}

end of insertion from Styles.css -->
  <head runat="server">
    <link href="/TZ/Styles.css" type="text/css" rel="stylesheet"> <!--
Applicable content inserted above -->
    <title>Action</title> 
  </head>
  <body bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0"
MS_POSITIONING="GridLayout">
    <form id="frmActionForm" method="post" runat="server">

    <asp:Label id="lblTestKey"
      style="z-index: 1; position: absolute; left: 8px; top: 8px; width: 214px;
height: 27px" 
      runat="server" CssClass="Text">Key</asp:Label>

    <asp:TextBox id="txtTestKey"
      style="z-index: 2; position: absolute; left: 224px; top: 8px; width:
208px; height: 27px" 
      runat="server" CssClass="Text"
      AutoPostBack="True" TabIndex="1"></asp:TextBox>

    <asp:Label id="lblTestText"
      style="z-index: 3; position: absolute; left: 448px; top: 8px; width:
118px; height: 27px" 
      runat="server" CssClass="Text">Text</asp:Label>

    <asp:TextBox id="txtTestText"
      style="z-index: 4; position: absolute; left: 568px; top: 8px; width:
208px; height: 27px" 
      runat="server" CssClass="Text" TabIndex="2"></asp:TextBox>

    <asp:DataGrid id="dgrTestGrid"
      style="z-index: 43; position: absolute; left: 16px; top: 508px; width:
2486px; height: 32px" 
      Caption="Caption Text" CaptionAlign="Left"
      runat="server" CssClass="Text" AutoGenerateColumns="False"
BorderWidth="3px" wcaSortExpr="" TabIndex="27">
      <HeaderStyle BackColor="Silver"/>
      <ItemStyle BorderWidth="1px"/>
      <AlternatingItemStyle BackColor="PaleGoldenrod"/>
      <EditItemStyle BackColor="DarkGoldenrod" Height="32px"/>
      <Columns>
      <asp:BoundColumn DataField="@Key" ReadOnly="True"
ItemStyle-HorizontalAlign="Right" ItemStyle-Width="25px"
        DataFormatString="{0:#0}" SortExpression="@Key" HeaderText="#">
        <HeaderStyle HorizontalAlign="Right"/></asp:BoundColumn>
      <asp:BoundColumn DataField="TestColSN" ItemStyle-HorizontalAlign="Left"
ItemStyle-Width="230px"
        SortExpression="TestColSN" HeaderText="Col SN">
        <HeaderStyle HorizontalAlign="Left"/></asp:BoundColumn>
      <asp:EditCommandColumn ButtonType="PushButton" HeaderText="Edit"
EditText="Edit" UpdateText="Update" CancelText="Cancel" />
      <asp:ButtonColumn ButtonType="PushButton" HeaderText="Delete"
Text="Delete" CommandName="Delete" />
      </Columns>
      </asp:DataGrid>

    <asp:Button id="btnSave"
      style="z-index: 46; position: absolute; left: 16px; top: 864px; width:
104px; height: 32px" 
      runat="server" CssClass="Text" TabIndex="30" Text="Save"></asp:Button>

    </form>
  </body>
</html>
ASP doesn't really help, since I have nowhere to run it.  If you just save your
ASP-generated HTML (as either "web page, HTML only" or "web page, complete"),
does that show the bug?  If so, please attach that here?

Note that you should use
https://bugzilla.mozilla.org/attachment.cgi?bugid=297733&action=enter instead of
pasting large amounts of text into the bug...
Captions for the two DataGrids in this page are located at lines 199 and 209.
Oh, I see.  You're using <caption align="left">.  From
http://www.w3.org/TR/html401/struct/tables.html#h-11.2.2 we have:

Attribute definitions
  align = top|bottom|left|right [CI]
  # left: The caption is at the left of the table.

Which is what we do.  It sounds like IE and Opera just don't support the "align"
attribute on captions, so they render this markup as if it were not set.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: