View Full Version : Creating a Table with HTML: blank space problem
RedKnight
09-17-2009, 07:18 PM
I have been experimenting with the use of tables in vBulletin and feel that the format, when coverted to BBCode, will be of great value in displaying various information. Unfortunately when I create a table and inexplicable white space is always displayed above the table, and appears that the larger the table the larger the white space. Does anyone know of a solution to this issue? I have include the basic table coding for reference.
<table border=1 cellpadding=5 width=100%>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td>Item 1</td>
<td>Item 2</td>
<td>Item 3</td>
</tr>
<tr>
<td>Item A</td>
<td>Item B</td>
<td>Item C</td>
</tr>
</table>
Digital Jedi
09-17-2009, 07:38 PM
Could you post a screen shot of what the white space looks like?
RedKnight
09-17-2009, 08:01 PM
Could you post a screen shot of what the white space looks like?
I guess... but it is just, well blank. Let me see what I can do.
There it is, I've attached a quick screenshot. I've upped the columns to 5 in the attached example, because it appears that the space gets longer the larger the table is. It appeats that the non-coded space is being displayed before the table for some reason.
<table border=1 cellpadding=5 width=100%>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
<th>Column 5</th>
</tr>
<tr>
<td>Item 1</td>
<td>Item 2</td>
<td>Item 3</td>
<td>Item 4</td>
<td>Item 5</td>
</tr>
<tr>
<td>Item A</td>
<td>Item B</td>
<td>Item C</td>
<td>Item D</td>
<td>Item E</td>
</tr>
</table>
Lynne
09-18-2009, 12:59 AM
Check the page source of the post and see what is going on with the html in there.
Digital Jedi
09-18-2009, 04:59 AM
This may seem trivial, but have you tried putting the quotation marks in the table tag where they should be?
RedKnight
09-18-2009, 03:30 PM
This may seem trivial, but have you tried putting the quotation marks in the table tag where they should be?
Although documentation does suggest the use of with or without quotation marks I did try both ways with the same result.
Now, with some tinkering I have been able to confirm that for some unknown reason the what is displaying is all non-coded blank spaces before the table, so using the code as:
<table border=1 cellpadding=5 width=100%><tr><th>Column 1</th><th>Column 2</th><th>Column 3</th><th>Column 4</th><th>Column 5</th></tr><tr><td>Item 1</td><td>Item 2</td><td>Item 3</td><td>Item 4</td><td>Item 5</td></tr><tr><td>Item A</td><td>Item B</td><td>Item C</td><td>Item D</td><td>Item E</td></tr></table>
eliminates all the blank space, but does produce a coding nightmare. There must be something that I am missing that is having all the non-coded sections included for some reason.
Digital Jedi
09-18-2009, 06:36 PM
Although documentation does suggest the use of with or without quotation marks I did try both ways with the same result.
Now, with some tinkering I have been able to confirm that for some unknown reason the what is displaying is all non-coded blank spaces before the table, so using the code as:
<table border=1 cellpadding=5 width=100%><tr><th>Column 1</th><th>Column 2</th><th>Column 3</th><th>Column 4</th><th>Column 5</th></tr><tr><td>Item 1</td><td>Item 2</td><td>Item 3</td><td>Item 4</td><td>Item 5</td></tr><tr><td>Item A</td><td>Item B</td><td>Item C</td><td>Item D</td><td>Item E</td></tr></table>
eliminates all the blank space, but does produce a coding nightmare. There must be something that I am missing that is having all the non-coded sections included for some reason.
With something like that, I would run the Source Code through the vaildator (http://validator.w3.org/) and see if there are any errors and tackle them from the top down. Since this is on your board, you could have an unrelated code error creating the issue with the post.
--------------- Added 1253302743 at 1253302743 ---------------
Although documentation does suggest the use of with or without quotation marks I did try both ways with the same result.
Now, with some tinkering I have been able to confirm that for some unknown reason the what is displaying is all non-coded blank spaces before the table, so using the code as:
<table border=1 cellpadding=5 width=100%><tr><th>Column 1</th><th>Column 2</th><th>Column 3</th><th>Column 4</th><th>Column 5</th></tr><tr><td>Item 1</td><td>Item 2</td><td>Item 3</td><td>Item 4</td><td>Item 5</td></tr><tr><td>Item A</td><td>Item B</td><td>Item C</td><td>Item D</td><td>Item E</td></tr></table>
eliminates all the blank space, but does produce a coding nightmare. There must be something that I am missing that is having all the non-coded sections included for some reason.
Wait, I just realized something. Quick question. You say this is BBCode, right? In what manner are you presenting tables as BBCode?
RedKnight
09-18-2009, 09:04 PM
With something like that, I would run the Source Code through the vaildator (http://validator.w3.org/) and see if there are any errors and tackle them from the top down. Since this is on your board, you could have an unrelated code error creating the issue with the post.
--------------- Added 1253302743 at 1253302743 ---------------
Wait, I just realized something. Quick question. You say this is BBCode, right? In what manner are you presenting tables as BBCode?
Right now the experimentation is strictly HTML. I have created a simple BBCode for it, but it is not relevant at this time; it does the same thing.
As for any "validator", I could try that but this is the only place such a problem occurs.
Digital Jedi
09-18-2009, 09:47 PM
Right now the experimentation is strictly HTML. I have created a simple BBCode for it, but it is not relevant at this time; it does the same thing.
As for any "validator", I could try that but this is the only place such a problem occurs.
That is most likely why your having the problem. All of your line breaks in code will be converted to line breaks once parsed inside of the post message area. The only way around that, that I know if, is to do the straight line code as you mentioned.
There are a number of modifications here on the site that attempt BBCode Tables in various ways. You might want to take a look at them, if at the very least just to get some ideas.
RedKnight
09-18-2009, 10:15 PM
That is most likely why your having the problem. All of your line breaks in code will be converted to line breaks once parsed inside of the post message area. The only way around that, that I know if, is to do the straight line code as you mentioned.
There are a number of modifications here on the site that attempt BBCode Tables in various ways. You might want to take a look at them, if at the very least just to get some ideas.
If that's the case, shouldn't the HTML work?
Digital Jedi
09-18-2009, 11:27 PM
In a post, all line breaks will be converted to <br /> in HTML once posted. Unless your HTML is all on one line, you'll always get those spaces.
RedKnight
09-19-2009, 01:26 PM
In a post, all line breaks will be converted to <br /> in HTML once posted. Unless your HTML is all on one line, you'll always get those spaces.
I see. So no matter what I do with HTML, or a BBCode equivilant, since I have everything appearing in a user friendly format the blanks will be displayed. The only solution I have would be to display the code in one continuous line.
If I were to consider a modification to have a table option included in the program, do you have a suggestion on which would be best?
bobster65
09-19-2009, 01:53 PM
If I were to consider a modification to have a table option included in the program, do you have a suggestion on which would be best?
This one: https://vborg.vbsupport.ru/showthread.php?t=107985
RedKnight
09-19-2009, 01:59 PM
This one: https://vborg.vbsupport.ru/showthread.php?t=107985
Great! Thanks Bob.
Digital Jedi
09-20-2009, 02:41 AM
I didn't realize that had been updated for 3.8. I may have to give a second look.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.