Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Stretching html table column will not fit

Stretching html table column will not fit

Scheduled Pinned Locked Moved ASP.NET
htmlsysadminhelpquestion
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dptalt
    wrote on last edited by
    #1

    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>

    N A N A 4 Replies Last reply
    0
    • D dptalt

      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>

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • D dptalt

        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>

        A Offline
        A Offline
        Anurag Gandhi
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • D dptalt

          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>

          N Offline
          N Offline
          nabber
          wrote on last edited by
          #4

          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>

          1 Reply Last reply
          0
          • D dptalt

            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>

            A Offline
            A Offline
            April Fans
            wrote on last edited by
            #5

            remove "width:250px"

            April Comm100 - Leading Live Chat Software Provider

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups