Stretching html table column will not fit
-
I have an asp label in a table as shown below. The label text is set in the codebehind. I would like the table column to stretch when the label text is to long to fix instead of it wrapping to the next line. How can this be accomplished? <table cellpadding="0" cellspacing="0" style="width: 100%;"> <tr> <td style="width: 250px">> <asp:Label ID="Label2" runat="server" Text="Label" Font-Size="9pt"></asp:Label>
-
I have an asp label in a table as shown below. The label text is set in the codebehind. I would like the table column to stretch when the label text is to long to fix instead of it wrapping to the next line. How can this be accomplished? <table cellpadding="0" cellspacing="0" style="width: 100%;"> <tr> <td style="width: 250px">> <asp:Label ID="Label2" runat="server" Text="Label" Font-Size="9pt"></asp:Label>
You're getting just what you've asked for. The width is set to a specific value, 250px, and the rendering engine is honoring that. Remove the width or possibly use a percentage rather than a fixed value.
I know the language. I've read a book. - _Madmatt
-
I have an asp label in a table as shown below. The label text is set in the codebehind. I would like the table column to stretch when the label text is to long to fix instead of it wrapping to the next line. How can this be accomplished? <table cellpadding="0" cellspacing="0" style="width: 100%;"> <tr> <td style="width: 250px">> <asp:Label ID="Label2" runat="server" Text="Label" Font-Size="9pt"></asp:Label>
Try No Wrap for the text inside the your td:
<td style="white-space:nowrap;">
It will stretch the text inside your table cell. Hope this will help.Anurag Gandhi. http://www.gandhisoft.com Life is a computer program and every one is the programmer of his own life.
-
I have an asp label in a table as shown below. The label text is set in the codebehind. I would like the table column to stretch when the label text is to long to fix instead of it wrapping to the next line. How can this be accomplished? <table cellpadding="0" cellspacing="0" style="width: 100%;"> <tr> <td style="width: 250px">> <asp:Label ID="Label2" runat="server" Text="Label" Font-Size="9pt"></asp:Label>
To Control the text don't wrapped ,Just add a style "white-space:nowrap" to "Label2". **:It's not good to adding this style about "td". Sample:
<table cellpadding="0" cellspacing="0" style="width: 100%;"> <tr> <td style="width: 250px"> <asp:Label ID="Label2" runat="server" Text="Label" Font-Size="9pt" Style="white-space: nowrap"></asp:Label> </td> </tr> </table>
-
I have an asp label in a table as shown below. The label text is set in the codebehind. I would like the table column to stretch when the label text is to long to fix instead of it wrapping to the next line. How can this be accomplished? <table cellpadding="0" cellspacing="0" style="width: 100%;"> <tr> <td style="width: 250px">> <asp:Label ID="Label2" runat="server" Text="Label" Font-Size="9pt"></asp:Label>
remove "width:250px"
April Comm100 - Leading Live Chat Software Provider