Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2004, 05:20 AM
Authorized User
 
Join Date: Feb 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default For the experienced ones...

Hi!

Im making a newspaper website witch I will write articles in. These articles will be displayed in two columns, just like in a magasin. I have written som code for this, but It has some flaws that I thougth you guys might be able to help me out with.

Thanks in advance!

/Thomas
 
Old March 2nd, 2004, 10:50 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You are going to have a hard time getting a browser to render formatting well the way you desire it too simply because of the limitations of HTML and the differences between browsers and individual's settings. Unless you use a fixed width font, using "characters/2" won't properly divide the text into two even columns as you have found out.

But regarding the splitting of words, you'll need to find your split point, then backup until you encounter a space so you don't chop words.

<opinion>
A web page shouldn't rely on a strict layout when you are building something that's dynamic (i.e. content is coming from some datastore). Plus, I think the user experience is soured by having to scroll up and down on the page as the text progresses from column to column. Save strict layout for a physical medium.
</opinion>

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old March 2nd, 2004, 11:25 AM
Authorized User
 
Join Date: Feb 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by planoie
 Unless you use a fixed width font, using "characters/2" won't properly divide the text into two even columns as you have found out.

But regarding the splitting of words, you'll need to find your split point, then backup until you encounter a space so you don't chop words.
I see, but how do I use a fixed font? Is it then possible to get two columns properly divided?

And how do I find the split point, and then backup until I encounter a space?

Please show me examples of how do do this!

PS: You might be right, this might be a bad idea, but I really want to make this work, so if you can I would appreciate the help.

/Thomas

 
Old March 2nd, 2004, 11:56 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

- Find a fixed width font and apply it to the style of the column. Courier is a fixed width font. There are plenty of online tutorials on how to create styles for your HTML elements.

- Find the character that's at the midpoint of your text, test it for a space, if it's not a space, try the character before it. Keep going until you find a space. If you still are not sure how to do this, maybe you should invest in a VBScript reference.
 
Old March 2nd, 2004, 01:47 PM
Authorized User
 
Join Date: Feb 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There are short VBScript references in the end of each Wrox ASP book right? I guess I'll have to try looking for it there...

 
Old March 2nd, 2004, 05:00 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

This doesn't mean that every thing will look lined up perfectly, but here you go.

<%
MyString = rs("whatever code you want to split")
LenString = Len(MyString)
HalfString = int(cInt(LenString) / 2) + 1
for n = HalfString to LenString
TempString = TempString & mid(MyString,n,1)
TempCutoff = instr(TempString," ") -1
BreakPoint = HalfString + TempCutoff
next
String1 = Left(MyString,BreakPoint)
String2 = Right(MyString,(LenString - BreakPoint))
%>

<table border="0" width="450" cellspacing="0" cellpadding="0">
<tr>
    <td width="48%" valign="top"><p align="justify"><%=String1%></td>
    <td width="4%" valign="top"></td>
    <td width="48%" valign="top"><p align="justify"><%=String2%></td>
</tr>
</table>

To line up everything and fill the last row in column one you would probably have to know how many fixed-width characters are allowable in each column, then write some code to accommodate that with fixed-width characters.
 
Old June 20th, 2007, 03:16 AM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Thomas,

Saw your topic on this forum.
Your online newspaper must be ready by now.
Can u guide me through the process of developing an online newspaper?

Things that i would want to know initially:

1. Which database to use
2. Develop the application using asp.net or php


Thanks


Quote:
quote:Originally posted by Thomas82
 Hi!

Im making a newspaper website witch I will write articles in. These articles will be displayed in two columns, just like in a magasin. I have written som code for this, but It has some flaws that I thougth you guys might be able to help me out with.

Thanks in advance!

/Thomas






Similar Threads
Thread Thread Starter Forum Replies Last Post
Has anyone experienced this kind of thing? jared_edge C++ Programming 1 September 18th, 2006 03:55 PM
Question to all the experienced C# programmers... ChiefOwl1971 C# 2 August 15th, 2006 03:27 PM
I am an experienced asp.net(c#) developer . JasonGuo ASP.NET 1.x and 2.0 Application Design 0 March 23rd, 2006 11:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.