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?
Using <table> in entries
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Using <table> in entries
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
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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
julianhopkins
- Regular
- Posts: 17
- Joined: Tue Mar 18, 2008 4:07 am
- Location: Malaysia
- Contact:
Re: Using <table> in entries
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
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
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.
If not: I use <pre>-tags for code. This should work, if nl2br is disabled.
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Using <table> in entries
<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
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
=Don=
-
julianhopkins
- Regular
- Posts: 17
- Joined: Tue Mar 18, 2008 4:07 am
- Location: Malaysia
- Contact:
Re: Using <table> in entries
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">
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!
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">