TinyPortal

Development => Support => Topic started by: NHBGEAR on January 12, 2007, 03:54:13 PM

Title: HTML block sizing problem
Post by: NHBGEAR on January 12, 2007, 03:54:13 PM
I'm trying to add a email signup form to a block. I'm shooting for this:

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.nhbgear.com%2Fimages%2Fjunk%2Fccnews.jpg&hash=0411944e5fdf38e85004219a2087f98d3597828c)

but I get this instead:

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.nhbgear.com%2Fimages%2Fjunk%2Fnewsblock.jpg&hash=18cd66b1e438ebe93e45c67a629621cefa76971f)

Here is the basic code which seems to display correctly in straight HTML:

<div align="center">
<table border="0" cellspacing="0" cellpadding="3" bgcolor="#990000" style="border:2px solid #FFFFFF;">
<tr>
<td align="center" style="font-weight: bold; font-family:'Trebuchet MS',Verdana,Helvetica,sans-serif; font-size:16px; color:#FFFFFF;">NHB NEWS</td>
</tr>
<tr>
<td align="center" style="border-top:2px solid #FFFFFF">
<form name="optin" action="http://newsletter.com/d.jsp" target="_blank" method="post" style="margin-bottom:2;">
<input type="hidden" name="m" value="xxxxxxxxxxx">
<input type="hidden" name="p" value="xx">
<font style="font-weight: normal; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:12px; color:#FFFFFF;">Email:</font> <input type="text" name="ea" size="20" value="" style="font-size:10pt; border:1px solid #999999;">
<input type="submit" name="go" value="Go" class="submit" style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:10pt;">
</form>
</td>
</tr>
</table>
</div>


Any ideas? Can't figure out why it creates so much space in the table and why it's spaced like that in the block. BTW, I'm programming-challenged so if this is painfully obvious please don't hold it against me  ;)

thx

SMF 1.1.1 w/ TP 0.9.7.1 and Helios
Title: Re: HTML block sizing problem
Post by: jacortina on January 12, 2007, 05:05:04 PM
I think that the HTML/BBC block treats line breaks within your definition of the block as literals (adding line-breaks to the output).

You can try a version of your code without line-breaks:
<div align="center"><table border="0" cellspacing="0" cellpadding="3" bgcolor="#990000" style="border:2px solid #FFFFFF;"><tr><td align="center" style="font-weight: bold; font-family:'Trebuchet MS',Verdana,Helvetica,sans-serif; font-size:16px; color:#FFFFFF;">NHB NEWS</td></tr><tr><td align="center" style="border-top:2px solid #FFFFFF"><form name="optin" action="http://newsletter.com/d.jsp" target="_blank" method="post" style="margin-bottom:2;"><input type="hidden" name="m" value="xxxxxxxxxxx"><input type="hidden" name="p" value="xx"><font style="font-weight: normal; font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:12px; color:#FFFFFF;">Email:</font> <input type="text" name="ea" size="20" value="" style="font-size:10pt; border:1px solid #999999;"><input type="submit" name="go" value="Go" class="submit" style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:10pt;"></form></td></tr></table></div>

Or, I believe, you can use a scriptbox block type.
Title: Re: HTML block sizing problem
Post by: NHBGEAR on January 12, 2007, 05:25:31 PM
That was it! Thanks very much, JAC.