Results 1 to 3 of 3

Thread: setting the max-width for a div w/o scrollbars.

  1. #1
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default setting the max-width for a div w/o scrollbars.

    Is it possible to set a span/div with a max-width w/o the scrollbars being present.
    I would basically like to mimic the "input" html tag with in a html table.
    I would like to use the left,right cursor arrows within the span/div.
    Any help would be appreciated.
    Steve
    e.g.
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html>
        <head>
            <title>scroll</title>
    
        </head>
        <body>
        <table border="1"> 
            <thead style="background-color:white">
                 <tr>
                      <th>One</th>
                      <th>Two</th>
                 </tr>
            </thead>
            <tbody>
                <tr>
                      <td>Data</td>
                      <td><div style="max-width:20px">sdffffffffffffffffffffffffffffffffffffffffffffffffffffffff</div></td>
                </tr>
            </tbody>
        </table>
        </div></td></tr></table>
        </body>
    </html>

  2. #2
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    im not sure if i understood you right... in your example are no scrollbars visible...
    the content grows over the border of the div.. (on winxp/chrome)

    if you want to enable scrolling you have to add this to the div/span:


    overflow:scroll;

  3. #3
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I know overflow:scroll allows you to scroll. I want to be able to scroll w/o the scrollbars. Basically the same the behavior as input input text field. The input text field allows you to scroll with just using the left,right cursor keys.

    I basically want to embed the div/span in a table td element. I want to have a max size for the div/span, much like you have can have a max size for the input text field.
    e.g
    <input type="text" size="30" />
    where 30 is the max size.
    convert the following to a div/span.
    <span style=".."> </span>

    I can probably use a readonly input field but that seems like a hack.

    Steve

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •