Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have A table

and in my table's one row i add one column

but when i resize my window.the column text and the space get disturb

how can i fix it.

i am using this code...


XML
<tr>
                <td colspan="3" width="100%">
                    <table width="100%" align="right">
                         <tr>
                            <td width = "60%" align = "left">
                                <%--<div id="div1" runat="server" class="divLoggedInAs">
                                    You are logged in as: <asp:Label ID="lblLoggedInAsEmailId" runat="server" CssClass="labelLoggedInAs"></asp:Label>
                                '</div>--%>

                                    You are logged in as: <asp:Label ID="lblLoggedInAsEmailId" runat="server" CssClass="labelLoggedInAs"></asp:Label>

                            </td>

                            <td align="right" width="13%">
                                <font size="2" face="Verdana" color="#000000">
                                    <a onclick="window.open('../TransactionStatus.aspx','newWindow','left=300,Top=170,resizable=no,toolbar=0,scrollbars=no,directories=0,status=0,menubar=0,width=550,height=520')" onMouseOver="this.className='AMouseOver';" onMouseOut="this.className='AMouseOutHeader';" style="cursor:pointer;">Track Transaction</a>
                                </font>
                            </td>
                            <td align="center" width="2%">
                                <font size="2" face="Verdana" color="#000000">
                                |
                                </font>
                            </td>

                            <td align="right" width="13%">
                                <font size="2" face="Verdana" color="#000000">
                                    <a onClick="window.open('../ExchangeRateCalc.aspx','newWindow','left=300,Top=170,resizable=no,toolbar=0,scrollbars=no,directories=0,status=0,menubar=0,width=550,height=520')" onMouseOver="this.className='AMouseOver';" onMouseOut="this.className='AMouseOutHeader';" style="cursor:pointer;">Fee Calculator</a>
                                </font>
                            </td>

                            <td align="center"width="2%">
                                <font size="2" face="Verdana" color="#000000">
                                |
                                </font>
                            </td>

                            <td align="right" width="13%">
                                <font size="2" face="Verdana" color="#000000">
                                    <%--<a onclick = "ShowCustomerServiceWindow(); id="hl1" style="float: right; margin: 14px 0 10px 0;">Customer Service</a>--%>
                                    <a onclick="ShowCustomerServiceWindow();" onMouseOver="this.className='AMouseOver';" onMouseOut="this.className='AMouseOutHeader';" style="cursor:pointer;">Customer Service</a>
                                    <%--<a onclick="window.open('../CustomerServiceCenter.aspx','newWindow','left=300,Top=170,resizable=no,toolbar=0,scrollbars=no,directories=0,status=0,menubar=0,width=550,height=520')" onMouseOver="this.className='AMouseOver';" onMouseOut="this.className='AMouseOutHeader';" style="cursor:pointer;">Customer Service</a>--%>
                                </font>
                            </td>
                        </tr>
                    </table>
                </td>
           </tr>






i want that when i resize my window the text on the table's column not get disturb.they remain at their orignol position.
Posted
Comments
Muralikrishna8811 4-Jun-12 7:42am    
Hi

In that case you can achieve by providing exact width of table like

<table width="960px"
prince_rumeel 4-Jun-12 7:47am    
I am giving 100% to my table.
and 1st column i give 40%
2nd 10
and so on...

i am managing by using %

and i want to manage it using %

so plz help me about it...

there is a css template named SKELETON that resize the columns with window resizing!
scott hanselman use SKELETON for his own blog!
Skeleton is very light weight css and javascripts files, and mobile ready!
Skeleton[^]
 
Share this answer
 
Hi,

You need to understand Relative and Absolute positioning with HTML controls.

if you specify fix width and height value then your cell text will not scattered even after windows resizing.

See this link for difference between Absolute and Relative Positioning.

thanks
-Amit.
 
Share this answer
 
Comments
prince_rumeel 4-Jun-12 7:54am    
mean you want to say.that i give table width in PX?

ok i give 1024px width to table...

i give 780px to my 1st col.
now i give 133 to my other 3 col

will it work?
AmitGajjar 4-Jun-12 7:57am    
yes if you specify fixed width then your content will not scattered. but fix width is not preferable. as screen resolution may change by different users. Scrollbar will be appear if user's resolution will changed.
When ever you define the table width in percentage,
it will re-size its position according with screen.
Defining table width in pixels(px) can over come your problem.
If you want to use only percentage for Width, then I guess you can't.

Regards,
AP
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900