Formatting problem with layout.  
Author Message
IgorV





PostPosted: ASMX Web Services and XML Serialization, Formatting problem with layout. Top

Well I'm new to asp. software and I'm teaching myself. Never had this problem with HTML so I'm not sure what the difference is.

Problem: my tables are shrinking and moving all my content when the Internet Exploerer is shrunk in size. So unless the Internet Explorer is full size my content, text and everything moves. The tables aren't holding their form and content in place. Tables are all set in percents (for widths).

Anyone know how I can fix this Thank you.



.NET Development14  
 
 
Badri Narayanan





PostPosted: ASMX Web Services and XML Serialization, Formatting problem with layout. Top

When you specify width in perent, then the layout is auto audjusted relatively to the width of the parent container. Here the parent is the BODY which is the entire browser area. So when you reduce the size of the browser window, the width of BODY (the container) also gets reduced and as a result, the TABLE width (which is specified in percentage) is adjusted accordingly.

suppose the TABLE has two columns with widths 30% and 70% respectively

Browser Window Width = 1000px
BODY width = 1000px (width of Browser)
TABLE first Column width = 300px
TABLE second Column width = 700px

Now browser window is re-sized

Browser Window Width = 600px
BODY width = 600px (width of Browser)
TABLE first Column width = 180px
TABLE second Column width = 420px

In order to have the TABLE columns not re-size, you should specify absolute width values.
<table width="600px">
<colgroup>
<col width="200px" />
<col width="400px" />
</colgroup>
</table>

- Badri


 
 
IgorV





PostPosted: ASMX Web Services and XML Serialization, Formatting problem with layout. Top

Thank you Badri.

I'm going to try it and see what happens.