+ Reply to Thread
Results 1 to 10 of 10

Thread: table cell problem

  1. #1
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    table cell problem

    Guys i am having problems with the text in the table

    The Student Info is overflowing from the table.

    I have put the width as 800 still its overflowing its showing outside the table cell

    any idea how i can fix it
    Code:
    <table style="width:800px;">
    <thead>
    <tr><th style="text-align:left;"><em><%=Title%></em></th></tr>
    </thead>
    <tr>
    <td style="width:800px;"><strong><%=StudentName%></strong>
    <br />
    <div style="width:800px;"><%=StudentInfo%></div>
    </td>
    </tr>
    </table>
    

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    The cell should expand with content inside it...but you could try changing your div to have the following:
    Code:
    <div style="overflow: scroll"><%=StudentInfo%></div>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #3
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    Jason,

    thanks for your reply.


    It doesnt work

    With Scroll it creates a scroll bar we dont want the scroll bar I tried overflow:hidden but then it hides the text

    what I want is I want the text in the cell when the text reaches the end of the cell I want it to scroll down like a paragraph

  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    In IE6, I'm unable to duplicate the problem you're having. It's quite possible that you might have some other styling settings that is causing this issue. On my test, the cell grows to accommodate the content.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  5. #5
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    2,386
    Blog Entries
    5
    Real Name
    Wolff
    Rep Power
    15

    Tried you example in both FF and IE8 and it wraps the text at 800px just fine.
    Wolffy
    .-- ----- ..-. ..-. -.--
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Void where prohibited by law. Not valid in California. Your mileage may vary.

  6. #6
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    Ok I had a table and its style sheets assigned to it

    SO I decided to remove tables and use css

    Code:
    <div style="width:800px; padding:10px;">
    <%
    sqlstr = "SELECT * FROM Students"
    Set rs = Conn.Execute(sqlstr)
    
    If Not  .EOF Then
    	Do While Not rs.EOF
    %>
    <br/>
    <em><%=rs("Title")%></em><br/>
    <strong><%=rs("StudentName")%></strong>
    <br />
    
    <%=rs("StudentInfo")%>&nbsp; <a href="studentinfo.asp?id=<%=rs("StdId")%>">(Read the article)</a><br/><br />
    
    <%
    	rs.MoveNext
    	Loop
    %>
    
    </div>
    
    here also the text overflows outside the div.

    any idea how to keep the text within the div

  7. #7
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    2,386
    Blog Entries
    5
    Real Name
    Wolff
    Rep Power
    15

    I tried your snippet in Firefox, Opera, and 3 versions of IE and they all wrap the text a 800. I used the following based on your snippet above.
    Code:
    <html>
      <head>
    
      <title></title>
      </head>
      <body>
       <div style="width:800px; padding:10px;">
    <em>MY Title</em><br/>
    <strong>"StudentName"</strong>
    <br />
    
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent semper semper fermentum. 
    Cras semper, dolor ut posuere hendrerit, nunc tortor pretium ipsum, ac rutrum diam&nbsp;
    <a href="studentinfo.asp?id=1234">(Read the article)</a><br/><br />
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent semper semper fermentum. 
    Cras semper, dolor ut posuere hendrerit, nunc tortor pretium ipsum, ac rutrum diam&nbsp;
    <a href="studentinfo.asp?id=1234">(Read the article)</a><br/><br />
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent semper semper fermentum. 
    Cras semper, dolor ut posuere hendrerit, nunc tortor pretium ipsum, ac rutrum diam&nbsp;
    <a href="studentinfo.asp?id=1234">(Read the article)</a><br/><br />
    
    </div>
    
      </body>
    </html>
    
    I also changed the width from 800 to several other values and in each case the text wrapped accordingly.
    Wolffy
    .-- ----- ..-. ..-. -.--
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Void where prohibited by law. Not valid in California. Your mileage may vary.

  8. #8
    Barn Loyal todd2006 is an unknown quantity at this point todd2006's Avatar
    Join Date
    Mar 2008
    Posts
    889
    Rep Power
    4

    Wolfy,

    the problem is the studentInfo field has a lot of information in table.

    Is there a way I can have a break in the code where after so many words it goes on the next line

    todd

  9. #9
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    2,386
    Blog Entries
    5
    Real Name
    Wolff
    Rep Power
    15

    I tried it again with almost 5000 characters for studentInfo and it worked fine. I'm beginning to think that there is something in the DATA that is causing the problem, not the markup.
    Wolffy
    .-- ----- ..-. ..-. -.--
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Void where prohibited by law. Not valid in California. Your mileage may vary.

  10. #10
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Todd,

    Load your page in your browser. Then, right-click and select "View Source". Copy and paste the source here. Also, if you have a separate style sheet, copy and paste that here, as well.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread

Similar Threads

  1. Dynamically Reference Worksheet Cell/Range
    By BLaaaaaaaaaarche in forum Microsoft Office
    Replies: 2
    Last Post: June 18th, 2008, 04:59 PM

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

SEO by vBSEO