Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Two column text template

Anyone know how (or willing to share) a template that would format text into two columns with the headline across the top of both?

George Carvill
Wednesday, September 18, 2002

You might try this in the body:

<table border = 1>
<tr>
<th colspan=2>Headline</th>
</tr>
<tr>
<td>First colum text</td>
<td>Second solum text</td>
</tr>
</table>

Jorgen Brenting
Wednesday, September 18, 2002

Here's an example of a fixed-width, two-column template:

http://www.goshen.edu/publish/temp2g.html

Alex Chernavsky
Wednesday, September 18, 2002

Buiding a table on the fly with a script is fun: (once Michael showed me how)

Here is the script for the articles/pictures table on this page:
http://tk-jk.net/Bridgers/

<table border="0" width="90%">
<tr>
<td>{$ foreach x in (or(folder "Mainpages")(folder "Workfolder"))&nbsp;$}
<tr>
<td valign="top" align="left"><b><A href="{$x.link$}">{$x.Extra2$}</A></b>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p>{$x.Extra1$}</p>
</blockquote>
</td>
<td width="150" valign="center" align="left">{$x.Sidebar$}</td>
</tr>
<tr>
<td>{$next$}</td>
</tr>
</table>

tk
Wednesday, September 18, 2002

OK, but now something more complex:

What if you want to display the {$.body$} of your articles in two columns ? is there a possibility ?

Of course, without using extrafields . The content must be  divided in two approximatively equal parts and displayed in two columns. The person who types content doesn't have to care where he has to "break" the content. And without using the netscape only tag "multicol". It must work on every browser.

(Don't answer me it's not very accurate from a usability perspective, I agree, but sometimes deciders just don't care...)

Same kind of problem : how can you display in two or three columns a full "foreach" generated list ? I've not found a way to "break in multiple parts" the execution of loops.

(why such demand ? we would like to build lists looking like the frontpage of "the register" http://www.theregister.co.uk/ )

vincent benard
Thursday, September 19, 2002

Ah, the famous "snaking columns."

This is technically completely impossible to do in HTML. Old versions of Netscape had an incompatible, non-standard <columns> tag to do this, but almost all existing browsers will just ignore it.

Joel Spolsky
Thursday, September 19, 2002

One thing you CAN do is go horizontally, if that's OK, e.g., you can't do

A D G
B E H
C F I

but you can do

A B C
D E F
G H I

The way to do this is with CSS, wrap each element in a DIV tag with a certain width and the browser will wrap around when it runs out of room. This automatically resizes with the browser, too.

Joel Spolsky
Thursday, September 19, 2002

I think I get it.  You'd like to snake your teasters?  You'd like to put the first (or latest) 5 articles on the 1st column, the next 5 in the 2nd column, etc?

I don't think you can do it with CityScript today: foreach 1-5, foreach 6-10, foreach 11-15 ...

Adriaan might have figured it out in Java Script.

If it was me, I'd consider 2 alternatives.
1. Just put blurbs into a single column and hope that future versions of script will allow you to snake your article list.

2. I would define a subject and keyword/folder for each column: 1st column might be local news, 2nd column might be sports news, 3rd might be society news.  Then wait for future version of script that let you do what you want.

That's pretty much how I do the scripts on this page:
http://mlpa.org/
There is a script for latest articles list in the first column, scripts for minutes/annoucements and security reports in the 2nd column, and a script for the committee list in the 3rd column.

(perfection not yet achieved)

tk
Thursday, September 19, 2002

See

http://discuss.fogcreek.com/citydesk/default.asp?cmd=show&ixPost=3351&ixReplies=8

Adriaan van den Brand
Friday, September 20, 2002

Sorry. It was not the right link I'm affraid. I did answer it once in the forum, but can't find it back.

<<<***** ADD REAL SEARCH PLEASE ***>>>

http://www.milov.nl/forum.php/1/331

I'll see if I can find the other links at home. It is tricky, and you will need javascript, php or asp etc. (or an external copy/paste utility....

Adriaan van den Brand
Friday, September 20, 2002

*  Recent Topics

*  Fog Creek Home