-
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
-
how can you tell when you reached an end of a table cell?
-
I have no idea..... but some how it mmust be able to be done...
/Smirre
-
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.
-
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!
-
The image can be of diffrent sizes, this will effect the height of the td.....
/Smirre
-
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 ;)
-
Wow... why are you trying to do this without CSS?
One word... float.
-
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.
-
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!
-
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
;)
-
Cool. Excuse me while I do a happy dance.