|
Posted by Margaret on 07/09/05 16:30
J.O. Aho wrote:
> Margaret wrote:
>
>> I am sorry if this is OT and please tell me to go away if it is.
>>
>> I have a PHP script written by my Nephew (now in the USA working in a
>> summer camp so unavailable) which gets information from a database. I
>> can add all the stuff I need to the database and in the "longtext"
>> field can add html tags and so on and all works fine. But when I try
>> to get a table into it I works OK but a heap of <br> are added in
>> before the table shows meaning that I have to scroll right down the
>> page to be able to see anything.
>>
>> I've pasted the table into the database at the bottom of the page it
>> should be in.
>>
>> http://www.hampsteadparishchurch.org.uk/
>> to see the whole effect please click on "Parish Magazine", July -
>> Summer Fair. and scroll down.
>>
>> I can't see what might be putting all the <br>'s in - it doesn't do it
>> on anything except tables.
>
>
> As I don't know how you have inserted the data into the database, I
> can't say what has caused the <br /> to be added, and if you will only
> use one short line per cell, there aren't any real point in using
> <p></p> either, but together they make the big space between the
> "cells". The <br /> is already part of the original list and there it
> make sense to use it as you don't want everything in a long line.
>
> Check the php script that is used to display the data and see if it adds
> the <br /> and remove it from it and it should display your table in a
> more proper way. You can have your eyes open for nl2br() function, which
> is used to add <br> to places where there are a line break.
>
>
> //Aho
Thank you for your prompt reply, this is the line of code
<?php echo nl2br($mag['art_contents']) ?>
but when I removed the n12br it sorted the table but removed all the
formatting for all the other pages!! As the layout of the other pages
is more important than one small table I'd better leave well alone.
I really don't know what I'm doing. I only wish I could learn - I have
a heap of books but can't get my head around programming or scripting at
all.
Anyway, many thanks
Margaret
Navigation:
[Reply to this message]
|