Saturday, March 31, 2012

Table stucture changing when panel is displayed

Hi All,
I am having a wierd problem while displaying my panel. My code is
something like this

<table>
<tr>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>button in this cell</td>
</tr>
<tr>
<td colspan=4 width=400>
<panel>literal inside the panel</panel>
</td>
</tr>
</table
this is actually the structure of my repeater control, and I am
toggling the visibility of my panel on the client side, whenever the
button in the first row is clicked.
The approach works fine when the text in the literal is shorter than
the table width, which is 400. But, when it is longer and it had to be
wrapped, the entire table structure is messed up, the colums widths are
changing at each toggle of the panel display.
However, if I insert line breaks(<br>)in literal string, so that the
string between two line breaks is less than the page width, its working
perfect.
any idea why the table structure is messed up when the string is larger
than page width.

Any help is greatly appreciated.

ThanksPavan,

I think those results will vary from browser to browser depending on how
they render.

Have you tried using percentages for the widths instead of fixed values? (I
would try that - at least for the last column with the panel in it.)

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Pavan" <pavan27@.gmail.com> wrote in message
news:1126828985.224647.157820@.z14g2000cwz.googlegr oups.com...
> Hi All,
> I am having a wierd problem while displaying my panel. My code is
> something like this
> <table>
> <tr>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>button in this cell</td>
> </tr>
> <tr>
> <td colspan=4 width=400>
> <panel>literal inside the panel</panel>
> </td>
> </tr>
> </table>
> this is actually the structure of my repeater control, and I am
> toggling the visibility of my panel on the client side, whenever the
> button in the first row is clicked.
> The approach works fine when the text in the literal is shorter than
> the table width, which is 400. But, when it is longer and it had to be
> wrapped, the entire table structure is messed up, the colums widths are
> changing at each toggle of the panel display.
> However, if I insert line breaks(<br>)in literal string, so that the
> string between two line breaks is less than the page width, its working
> perfect.
> any idea why the table structure is messed up when the string is larger
> than page width.
> Any help is greatly appreciated.
> Thanks
tables alway resize to hold their content, unless the content has overflow
rules that prevents the content from getting larger.

try (large content is scrolled):

<table>
<tr>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>label</td>
<td width=100>button in this cell</td>
</tr>
<tr>
<td colspan=4>
<div style="width:100%;overflow:auto;">literal inside the div</div>
</td>
</tr>
</table
note: panel is not a valid html object

-- bruce (sqlwork.com)

"Pavan" <pavan27@.gmail.com> wrote in message
news:1126828985.224647.157820@.z14g2000cwz.googlegr oups.com...
> Hi All,
> I am having a wierd problem while displaying my panel. My code is
> something like this
> <table>
> <tr>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>button in this cell</td>
> </tr>
> <tr>
> <td colspan=4 width=400>
> <panel>literal inside the panel</panel>
> </td>
> </tr>
> </table>
> this is actually the structure of my repeater control, and I am
> toggling the visibility of my panel on the client side, whenever the
> button in the first row is clicked.
> The approach works fine when the text in the literal is shorter than
> the table width, which is 400. But, when it is longer and it had to be
> wrapped, the entire table structure is messed up, the colums widths are
> changing at each toggle of the panel display.
> However, if I insert line breaks(<br>)in literal string, so that the
> string between two line breaks is less than the page width, its working
> perfect.
> any idea why the table structure is messed up when the string is larger
> than page width.
> Any help is greatly appreciated.
> Thanks
Justin, Bruce,
I tried each of your approaches but unfortunately, neither of them
worked.
however, the problem is solved by packaging the literal inside the
panel with a table.

<tr>
<td colspan=4 width=400>
<panel>
<table>
<tr>
<td>literal inside the panel</td>
</tr>
</table>
</panel>
</td>
</tr
I would appreciate if anyone could explain this behavior.

Thanks.

Pavan wrote:
> Hi All,
> I am having a wierd problem while displaying my panel. My code is
> something like this
> <table>
> <tr>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>label</td>
> <td width=100>button in this cell</td>
> </tr>
> <tr>
> <td colspan=4 width=400>
> <panel>literal inside the panel</panel>
> </td>
> </tr>
> </table>
> this is actually the structure of my repeater control, and I am
> toggling the visibility of my panel on the client side, whenever the
> button in the first row is clicked.
> The approach works fine when the text in the literal is shorter than
> the table width, which is 400. But, when it is longer and it had to be
> wrapped, the entire table structure is messed up, the colums widths are
> changing at each toggle of the panel display.
> However, if I insert line breaks(<br>)in literal string, so that the
> string between two line breaks is less than the page width, its working
> perfect.
> any idea why the table structure is messed up when the string is larger
> than page width.
> Any help is greatly appreciated.
> Thanks

0 comments:

Post a Comment