Results 1 to 12 of 12

Thread: Text and Image, Layout??

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343

    Text and Image, Layout??

    I would like to create this kind of layout dynamic....
    The text and the image is retrived from a database with
    asp.



    Text Text Text ------------------------------
    Text Text Text |////////////////////////////|
    Text Text Text |////////////////////////////|
    Text Text Text |//////////Image//////////|
    Text Text Text |////////////////////////////|
    Text Text Text |////////////////////////////|
    Text Text Text -------------------------------
    Text Text Text Text Text Text Text Text Text
    Text Text Text Text Text Text Text Text Text
    Text Text Text Text Text Text Text Text Text
    Text Text Text Text Text Text Text Text Text

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  2. #2
    scoutt
    Guest
    how can you tell when you reached an end of a table cell?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    I have no idea..... but some how it mmust be able to be done...

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  4. #4
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    to get the number of cells in table using clientside javascript its

    document.all('table1').cells.length

    This returns all the cells in the table, so, if you divide it by the number of rows/columns you have you can work out the number of cells in row/column.
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  5. #5
    Hyperactive Member progressive's Avatar
    Join Date
    Sep 2001
    Location
    Manchester, UK
    Posts
    404
    use trial and error to figure out how many chars your td can hold
    before it affects the height.
    Then use ASP to split the text on the whitsepace closest to the maximum number of chars that the td can hold !!

    simple!

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    The image can be of diffrent sizes, this will effect the height of the td.....


    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  7. #7
    Hyperactive Member progressive's Avatar
    Join Date
    Sep 2001
    Location
    Manchester, UK
    Posts
    404
    Can you not enter the dimensions of the image in to the DB and pull these out along with the image.

    or

    Does ASP/VBSCRIPT not have the ability to find out an image size.
    Perl does by reading the bit stream of the file!

    There's no easy way to do this you'll have to see how many chars
    fit on a line and see how the size of the image affects the number
    of lines in the td. you should be able to see a pattern evolve.

    That's the only solution I can think of !

    shouldn't take long to see a pattern evolve,

    happy testing

  8. #8
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    Wow... why are you trying to do this without CSS?

    One word... float.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  9. #9
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    I'm bored.

    Code:
    <% @Language="VBScript" %>
    <%
      Dim CLOB
      Dim sinMyFile
      Dim FSO
    
      Set FSO = Server.CreateObject("Scripting.FileSystemObject")
      Set sinMyFile = FSO.OpenTextFile("myFile.txt")
    
      CLOB = sinMyFile.ReadAll
    
      sinMyFile.Close
      Set sinMyFile = Nothing
      Set FSO = Nothing
    %>
    <html>
      <head>
        <title>Float Example</title>
      <head>
      <body>
        <img style="float:right;" src="myImage.png"></img>
        <p><%=Replace(CLOB, vbCrLf, "</p><p>")%></p>
      </body>
    </html>
    I haven't tested this.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  10. #10
    Hyperactive Member progressive's Avatar
    Join Date
    Sep 2001
    Location
    Manchester, UK
    Posts
    404
    3 words....

    has undesired effect!

    Each browser renders this differently.

    Some browsers it just aligns it right and puts the text underneath, some browsers the image appears to be on top of the text and other browsers the text goes over the top of the image!

    Testetd on NS6, IE5.5, Opera, NS4.7!

  11. #11
    Hyperactive Member progressive's Avatar
    Join Date
    Sep 2001
    Location
    Manchester, UK
    Posts
    404
    doh!...my apologies CiberTHuG, it does appear to work after all. It was just my test text was a bit off. I had a long line of text wiithout spaces in eg

    fkljsdkfja;sjf;ashf;kasdhfk;hasdkfhuyasdgfsdaf

    It was the text that was causing the strange results as my table was set to 100 width!

    I added some spaces and it sorted itself out.

    Well you learn something new every day


  12. #12
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    Cool. Excuse me while I do a happy dance.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

Posting Permissions

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



Click Here to Expand Forum to Full Width