|
-
Mar 20th, 2002, 04:37 AM
#1
Thread Starter
Hyperactive Member
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
-
Mar 20th, 2002, 09:11 AM
#2
how can you tell when you reached an end of a table cell?
-
Mar 20th, 2002, 10:22 AM
#3
Thread Starter
Hyperactive Member
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
-
Mar 20th, 2002, 10:28 AM
#4
Fanatic Member
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.
-
Mar 20th, 2002, 11:33 AM
#5
Hyperactive Member
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!
-
Mar 20th, 2002, 12:16 PM
#6
Thread Starter
Hyperactive Member
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
-
Mar 20th, 2002, 12:34 PM
#7
Hyperactive Member
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
-
Mar 20th, 2002, 04:10 PM
#8
Frenzied Member
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.
-
Mar 20th, 2002, 08:39 PM
#9
Frenzied Member
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.
-
Mar 21st, 2002, 04:28 AM
#10
Hyperactive Member
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!
-
Mar 21st, 2002, 04:36 AM
#11
Hyperactive Member
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
-
Mar 21st, 2002, 09:56 AM
#12
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|