Page 1 of 1

Using <table> in entries

Posted: Tue Feb 22, 2005 4:02 pm
by David Rowe
If I insert

<table border = 1>
<tr>
<td>hi there</td>
</tr>
</table>

into my entry to create a tidy table, the table is displayed several rows down from where it is expected. Is there a reason for this?

Othere common html tags seem to work. Bug?

Re: Using <table> in entries

Posted: Tue Feb 22, 2005 4:22 pm
by garvinhicking
The reason is that by default serendipity has the NL2br (newline to break) plugin installed which converts every newline to a break. You can either remove that markup plugin (and then need to insert breaks manually!) or you remove the linebreaks after your <table> stuff.

Sadly this is because its very hard to make the nl2br plugin detect html tags and it would create other trouble possibly. We've discussed this quite often on the mailinglist, I think we had a solution to use a bbcode tag for entering tables or something like that...

Regards,
Garvin

Re: Using <table> in entries

Posted: Sun Mar 08, 2009 1:48 pm
by julianhopkins
I have a related problem, hope this is the right place to mention it.

I want to post a snippet of code (for people to copy and paste a hotlinked banner), the bbcode

Code: Select all

 tag works to display it, but it is all in one long line which is not nice (see here: http://julianhopkins.net/index.php?/pages/myblogs2009.html).

If I put it on two lines, the </br> tag is inserted, which means the code is no good for copying and pasting.

Any suggestion? Thanks :)

Re: Using <table> in entries

Posted: Sun Mar 08, 2009 4:03 pm
by onli
What happens if you disable nl2br for this entry and put the code in two lines? Does the bb-parser react?
If not: I use <pre>-tags for code. This should work, if nl2br is disabled.

Re: Using <table> in entries

Posted: Sun Mar 08, 2009 10:40 pm
by Don Chambers
<pre> may, or may not, work well depending on your template.

Another option might be <textarea>your code here </textarea>. I did this on several static pages, one of which is here:
http://www.optional-necessity.com/demo/ ... 0x250.html

Re: Using <table> in entries

Posted: Mon Mar 09, 2009 12:32 am
by julianhopkins
Thanks :)

I had tried <pre> already, but it made no difference at all.

The <textarea> works, but now the box it appears in is too small! :| Is there any way to determine how big it is?

Or maybe does it have something to do with the size of the panel as indicated in the code itself?

*Edit* No worries, I checked with http://www.w3schools.com/ (very useful resource) and found how to adjust the size using 'rows' and 'cols':
e.g. <textarea rows="5" cols="40">