Previous Thread
Next Thread
Print Thread
Hop To
#169844 12/06/2006 7:26 PM
Joined: Aug 2006
Posts: 1,649
Likes: 1
Pooh-Bah
Pooh-Bah
Joined: Aug 2006
Posts: 1,649
Likes: 1
To help answer another user's question I discovered (sort of) a bug when trying to post HTML tables in a post.

EXAMPLE:
Code
<TABLE align=center border=3 cellpadding=5 cellspacing=2>
  <TR>
     <TD>first column</TD>
     <TD>second column</TD>
   </TR>
   <TR>
     <TH colspan="2" align=center bgcolor="#999999"><font color="#eeeeee">second row colspan</font></TH>
   </TR>
   <TR>
      <TD colspan=2><TABLE border=5><TR><TD>nested table</TD></TR></TABLE></TD></TR>
</TABLE>

When typing HTML formatted like this, Threads is adding line breaks to it, which breaks what was intended:
Quote
<table align="center" border="3" cellpadding="5" cellspacing="2"><br> <tbody><tr><br> <td>first column</td><br> <td>second column</td><br> </tr><br> <tr><br> <th colspan="2" align="center" bgcolor="#999999"><font color="#eeeeee">second row colspan</font></th><br> </tr><br> <tr><br> <td colspan="2"><table border="5"><tbody><tr><td>nested table</td></tr></tbody></table></td><br></tr></tbody></table>

Here are what's intended, and what's produced (below). All that caused by <BR>'s. Apparently you need to not format your HTML for it to display correctly:


Attachments
245-HTML-Tables.gif


GangsterBB.NET (Ver. 7.6.1.1)
PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
jgeoff #169845 12/06/2006 7:40 PM
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
If as an admin you choose strictly HTML for your post then it should format it correctly. When using UBBcode and HTML it will add the linebreaks in.

Rick #169846 12/06/2006 7:44 PM
Joined: Aug 2006
Posts: 1,649
Likes: 1
Pooh-Bah
Pooh-Bah
Joined: Aug 2006
Posts: 1,649
Likes: 1

I used HTML only when I tested it...


GangsterBB.NET (Ver. 7.6.1.1)
PHP Version 5.6.40 / MySQL 5.7.23-23 (was 5.6.41-84.1) / Apache 2.4.54
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
jgeoff #169851 12/06/2006 11:58 PM
Joined: Jun 2006
Posts: 196
I
enthusiast
enthusiast
I Offline
Joined: Jun 2006
Posts: 196
Rick, in do_markup, find
PHP Code
	 $body = preg_replace( "#(\r\n|\r|\n)#i", "<br />", $body ); 

Move it to below the if statement right after it


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Forum Privacy Policy
by ECNet - 02/26/2024 11:58 AM
Who's Online Now
2 members (Geoff, domspeak), 353 guests, and 190 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)