[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

James

6/10/2002 4:57:00 PM

I am using a table in a ContentTemplate to place two controls side-by-side
and also using a <hr /> tag to give a line above them. I need the line to
run the width of the screen. The code below all works fine in IE, but when
you view it in a PDA emulator it seems to ignore the Width attributes.

How can I force it to use 100% of the screen width???

<mobile:Panel id="Panel1" runat="server">
<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice Filter="isHTML32"
Xmlns="http://schemas.microsoft.com/mobile/html32template...
<ContentTemplate>
<asp:Table id="Table1" runat="server" Width="100%"
HorizontalAlign="Center">
<asp:TableRow Width="100%">
<asp:TableCell ColumnSpan="2" Width="100%">
<hr />
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
Hello
</asp:TableCell>
<asp:TableCell>
World
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</ContentTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:Panel>



4 Answers

James

6/10/2002 6:06:00 PM

0

Worked it out!

Use standard HTML tag such as <TR> instead of <asp:TableRow> and you can
then correctly specify the table width....

However, is there a rational explanation for this?????


"James" <james_internet@hotmail.com> wrote in message
news:OX1di7IECHA.2232@tkmsftngp04...
> I am using a table in a ContentTemplate to place two controls side-by-side
> and also using a <hr /> tag to give a line above them. I need the line to
> run the width of the screen. The code below all works fine in IE, but
when
> you view it in a PDA emulator it seems to ignore the Width attributes.
>
> How can I force it to use 100% of the screen width???
>
> <mobile:Panel id="Panel1" runat="server">
> <mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
> <Choice Filter="isHTML32"
> Xmlns="http://schemas.microsoft.com/mobile/html32template...
> <ContentTemplate>
> <asp:Table id="Table1" runat="server" Width="100%"
> HorizontalAlign="Center">
> <asp:TableRow Width="100%">
> <asp:TableCell ColumnSpan="2" Width="100%">
> <hr />
> </asp:TableCell>
> </asp:TableRow>
> <asp:TableRow>
> <asp:TableCell>
> Hello
> </asp:TableCell>
> <asp:TableCell>
> World
> </asp:TableCell>
> </asp:TableRow>
> </asp:Table>
> </ContentTemplate>
> </Choice>
> </mobile:DeviceSpecific>
> </mobile:Panel>
>
>
>


(Joseph Croney (MSFT))

6/10/2002 11:55:00 PM

0

Hi James,
The <asp:Table /> control is designed for desktop browsers. As such it
utilizes a style attribute on the <tr> element to specify width, as shown
in the following example html output:

<table id="Table1" align="Center" border="0" style="width:100%;">
<tr style="width:100%;">
<td style="width:100%;"></td>
</tr>
</table>

Unfortunately not all mobile browsers support this syntax. If your goal is
to get two controls on the same line in a mobile browser, I suggest you
take advantage of the BreakAfter property. The BreakAfter property allows
you to specify if a break should be inserted before the next control, by
default it is set to true.

Thanks,
Joseph Croney
-----------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.

James

6/11/2002 10:31:00 AM

0

I tried the BreakAfter property but couldn't get it to work with lists.

<mobile:Form id="Form1" runat="server">
<mobile:List id="List1" runat="server" BreakAfter="False">
<Item Value="List1.1" Text="List1.1"></Item>
<Item Value="List1.2" Text="List1.2"></Item>
</mobile:List>
<mobile:List id="List2" runat="server">
<Item Value="List2.1" Text="List2.1"></Item>
<Item Value="List2.2" Text="List2.2"></Item>
</mobile:List>
</mobile:Form>


Thanks
James

"Joseph Croney (MSFT)" <jcroney@microsoft.com> wrote in message
news:M5Cc7lMECHA.2360@cpmsftngxa08...
> Hi James,
> The <asp:Table /> control is designed for desktop browsers. As such it
> utilizes a style attribute on the <tr> element to specify width, as shown
> in the following example html output:
>
> <table id="Table1" align="Center" border="0" style="width:100%;">
> <tr style="width:100%;">
> <td style="width:100%;"></td>
> </tr>
> </table>
>
> Unfortunately not all mobile browsers support this syntax. If your goal
is
> to get two controls on the same line in a mobile browser, I suggest you
> take advantage of the BreakAfter property. The BreakAfter property allows
> you to specify if a break should be inserted before the next control, by
> default it is set to true.
>
> Thanks,
> Joseph Croney
> -----------------------------------
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. © 2002 Microsoft Corporation. All rights
> reserved.
>


Julia Smit

6/13/2002 3:54:00 PM

0

If you really like to use the asp:table you can also solve your problem
with:

AspTable.Attributes.Add("width", "100%")
Put this line in the Page_load function.

In a simular way you can add onClick events to controls that useally don't
support them..



"James" <james_internet@hotmail.com> wrote in message
news:#281ciJECHA.1692@tkmsftngp05...
> Worked it out!
>
> Use standard HTML tag such as <TR> instead of <asp:TableRow> and you can
> then correctly specify the table width....
>
> However, is there a rational explanation for this?????
>
>
> "James" <james_internet@hotmail.com> wrote in message
> news:OX1di7IECHA.2232@tkmsftngp04...
> > I am using a table in a ContentTemplate to place two controls
side-by-side
> > and also using a <hr /> tag to give a line above them. I need the line
to
> > run the width of the screen. The code below all works fine in IE, but
> when
> > you view it in a PDA emulator it seems to ignore the Width attributes.
> >
> > How can I force it to use 100% of the screen width???
> >
> > <mobile:Panel id="Panel1" runat="server">
> > <mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
> > <Choice Filter="isHTML32"
> > Xmlns="http://schemas.microsoft.com/mobile/html32template...
> > <ContentTemplate>
> > <asp:Table id="Table1" runat="server" Width="100%"
> > HorizontalAlign="Center">
> > <asp:TableRow Width="100%">
> > <asp:TableCell ColumnSpan="2" Width="100%">
> > <hr />
> > </asp:TableCell>
> > </asp:TableRow>
> > <asp:TableRow>
> > <asp:TableCell>
> > Hello
> > </asp:TableCell>
> > <asp:TableCell>
> > World
> > </asp:TableCell>
> > </asp:TableRow>
> > </asp:Table>
> > </ContentTemplate>
> > </Choice>
> > </mobile:DeviceSpecific>
> > </mobile:Panel>
> >
> >
> >
>
>