1
basza
How to add a table to block
  • 2006/7/31 7:18

  • basza

  • Just popping in

  • Posts: 73

  • Since: 2004/6/21


I have a custom block to which I want to add a tabe inside.

The problem I am having is when I add the table I get this big huge gap between the top of the block to the start of the table. The code I'm using is below.
<table width='100%' border='0'>
  <
tr>
    <
th scope='col'><div align='center'><strong>Pair Symbol </strong></div></th>
    <
th scope='col'><div align='center'><strong>EUR/USD</strong></div></th>
    <
th scope='col'><div align='center'></div></th>
    <
th scope='col'><div align='center'></div></th>
  </
tr>
  <
tr>
    <
td><div align='center'><strong>Current Status </strong></div></td>
    <
td><div align='center'><strong>Open</strong></div></td>
    <
td><div align='center'></div></td>
    <
td><div align='center'></div></td>
  </
tr>
  <
tr>
    <
td><div align='center'><strong>Buy Price </strong></div></td>
    <
td><div align='center'><strong>1.111</strong></div></td>
    <
td><div align='center'></div></td>
    <
td><div align='center'></div></td>
  </
tr>
  <
tr>
    <
td><div align='center'><strong>Targets</strong></div></td>
    <
td><div align='center'><strong>1.22</strong></div></td>
    <
td><div align='center'><strong>1.365</strong></div></td>
    <
td><div align='center'><strong>1.5969</strong></div></td>
  </
tr>
  <
tr>
    <
td><div align='center'><strong>Stop Loss </strong></div></td>
    <
td><div align='center'><strong>1.5469</strong></div></td>
    <
td><div align='center'></div></td>
    <
td><div align='center'></div></td>
  </
tr>
</
table>

I s there something else I should be doing?

Thanks in advance

2
McNaz
Re: How to add a table to block
  • 2006/7/31 7:34

  • McNaz

  • Just can't stay away

  • Posts: 574

  • Since: 2003/4/21


This is a classic issue of the text sanitiser taking your carriage return characters and subsituting them with <br /> html tags (I think).

Try running your html code through a text editor to remove carriage returns (#13#10 on windows) then trying pasting that into you block.

HTH.

3
Quest
Re: How to add a table to block
  • 2006/7/31 11:31

  • Quest

  • Friend of XOOPS

  • Posts: 1034

  • Since: 2005/11/19


I believe this could be happening from any number of things. Most likely in your style.css. First you could try adding valign="top" to your block table. But if withing your style.css the table is defined differently then your addition to the block probably will have no effect. Also it could be in the div.blockcontent of the particular column you are placing the block, such as a padding issue or cellspacing issue.


Padding for something like this I have found to be the culprit in several cases.

I used the code you provided and created two blocks. Test Block and Test Block 2 and placed them in the centercenter top colomn. I am not real sure what you mean by HUGE gap because I really didn't have one (using the default theme). However, I was able to reduce what gap I had by editing the theme_blockcenter_c.html of the default theme and the style.css.

theme_blockcenter_c.html- change padding from 5px to 1px
style.css- in the centerCcolumn blockcontent I removed the borders by change 1px to 0px.

You can see the results here:
Your Blocks Here

I hope this gives you a direction to look in.

Quest

4
Herko
Re: How to add a table to block
  • 2006/7/31 12:11

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


What about the block type, what is it set to? HTML?

Herko

Login

Who's Online

190 user(s) are online (125 user(s) are browsing Support Forums)


Members: 0


Guests: 190


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits