HeadStand

[HSC] Table BBCode

67 posts in this topic

%7Boption%7D



File Name: [HSC] Table BBCode

File Submitter: HeadStand

File Submitted: 03 Oct 2010

File Category: Other style options



Creates HTML tables within post content.

Includes:
- Table headers ([th] tag)
- Table rows
- Alternating background colors


Example:


[table]

[th]Column 1[/th][th]Column 2[/th]

[tr][td=25]Cell 1[/td][td=75]Cell 2[/td][/tr]

[tr][td2]Cell 3[/td2][td2]Cell 4[/td2][/tr]

[/table]


This mod is compatible with IPB 3.1.x, IPB 3.2, and IPB 3.3



here to download this file

Buskopan, rastaX, Haku2 and 1 other like this

Share this post


Link to post
Share on other sites

Does it handle tables within tables?



I haven't tried it, but I don't see any reason why it shouldn't. The setup is the same as HTML tables, so if you're familiar with HTML tables, you should be able to accomplish this.

Share this post


Link to post
Share on other sites

Thank you for this very useful mod.:thumbsup:

Two things.
If I use this code:

[table=Kursentwicklung]

[tr][td][/td][td]Dax[/td][td]LevDax[/td][td]Short-Dax[/td][/tr]

[tr][td]Tag 1[/td][td]100[/td][td]100[/td][td]100[/td][/tr]

[tr][td]Tag 2[/td][td]95[/td][td]90[/td][td]105[/td][/tr]

[tr][td]Tag 3[/td][td]100[/td][td]99,47[/td][td]99,47[/td][/tr]

[/table] 


It will mess up the cell width. It seems to be a problem if I enter only numbers in the cells.

The second thing is,

if I use the table it will always produce 3 linebreaks before the table. A linebreak is automaticly added to every bbcode. So there is one for [table] [tr] and [td].
Maybe there is a workaround? I'm not sure.

Share this post


Link to post
Share on other sites

Thank you for this very useful mod.:thumbsup:



Two things.


If I use this code:


[table=Kursentwicklung]

[tr][td][/td][td]Dax[/td][td]LevDax[/td][td]Short-Dax[/td][/tr]

[tr][td]Tag 1[/td][td]100[/td][td]100[/td][td]100[/td][/tr]

[tr][td]Tag 2[/td][td]95[/td][td]90[/td][td]105[/td][/tr]

[tr][td]Tag 3[/td][td]100[/td][td]99,47[/td][td]99,47[/td][/tr]

[/table] 

It will mess up the cell width. It seems to be a problem if I enter only numbers in the cells. The second thing is, if I use the table it will always produce 3 linebreaks before the table. A linebreak is automaticly added to every bbcode. So there is one for [table] [tr] and [td]. Maybe there is a workaround? I'm not sure.

To work around the line breaks - just take them out of your actual code.

[table=Kursentwicklung][tr][td][/td][td]Dax[/td][td]LevDax[/td][td]Short-Dax[/td][/tr][tr][td]Tag 1[/td][td]ABC[/td][td]100[/td][td]100[/td][/tr][tr][td]Tag 2[/td][td]95[/td][td]90[/td][td]105[/td][/tr][tr][td]Tag 3[/td][td]100[/td][td]99,47[/td][td]99,47[/td][/tr][/table]

I'm still looking into the cell width. It looks like there might be an IPB bug (but I'm not 100% sure if that's by design or an actual bug) that when the option is left out of a tag (in this case, that would be the width), it uses the content of the tag instead. So, instead of

[td]100[/td]

You end up with

[td=100]100[/td]



Weird.

Share this post


Link to post
Share on other sites

It seems to be a problem in Opera, with your example code it displays this:
post-135437-0-57107700-1289624963_thumb.

While in Safari, Firefox and Chrome it looks normal:
post-135437-0-12341500-1289625031_thumb.


If I take away all the linebreaks in the table-bbcode it works in Opera (and still works the same way in the other browsers).

Do anyone know of another way to fix this? I think most users will take it line for line, since it's the most logical approach.

Share this post


Link to post
Share on other sites

Hi again, I think you should update the BBcode to use this in the [table]-tag:

<table border='1'>

<thead class='maintitle'>

<tr>

<th colspan="100">{option}</th>

</tr>

</thead>

{content}</table>



Although colspan="100" is not a very good solution to make it span over the entire table, changing the html from using <caption> for the {option}-tag will atleast fix the weird issue in Opera displayed above.

It wont solve the problem with IPB adding lots of <br /> tags in front though :(

Share this post


Link to post
Share on other sites

Hi again, I think you should update the BBcode to use this in the [table]-tag:


<table border='1'>

<thead class='maintitle'>

<tr>

<th colspan="100">{option}</th>

</tr>

</thead>

{content}</table>



Although colspan="100" is not a very good solution to make it span over the entire table, changing the html from using <caption> for the {option}-tag will atleast fix the weird issue in Opera displayed above.

It wont solve the problem with IPB adding lots of <br /> tags in front though :(


I'll give it a shot.

Share this post


Link to post
Share on other sites

I think this mod won't get around to prog a hook to work well...



I'm really really hoping that I misunderstood the above post, and that this comment was not directed at me and my capabilities.

Share this post


Link to post
Share on other sites

Sorry for the silly question but where in the ACP do you load this? I tried to load it as a hook and couldn't get it to work.

Share this post


Link to post
Share on other sites

Sorry for the silly question but where in the ACP do you load this? I tried to load it as a hook and couldn't get it to work.



No problem. :)

In the ACP, go to Look & Feel -> BBCode Management.
At the bottom of the page, you have an option to import BBCode from an XML file.

Let me know if that helps.

Share this post


Link to post
Share on other sites

Can you tell me where the table loads the css style for the borders please? The table tag has a 1px border within the bbcode but I cannot find where it is loading the border colour of #505050 from? I know I can change this within the tag itself but i'd like to load it from the skin.

Thanks

Share this post


Link to post
Share on other sites

A new version has been uploaded to the Marketplace. It contains a fix for the issue with numeric content in table cells (reported earlier in this thread).

Please read the installation instructions, even if you are upgrading, as the installation has changed.

Share this post


Link to post
Share on other sites

is there any fix for the line breaks issue with out loosing the format option in the editbox ?



Not yet, sorry. I'll look into it.

Share this post


Link to post
Share on other sites

Thank you.

I installed this Plugin. But i can't see it in the Editor..Like bold, font,sizes..how to add it there ? :shifty:

Thanks.

Share this post


Link to post
Share on other sites

Thank you.



I installed this Plugin. But i can't see it in the Editor..Like bold, font,sizes..how to add it there ? :shifty:



Thanks.



It should be in the "Other Styles" dropdown.

I was thinking about adding an icon to put it as an Editor button, but it would only give you

[table][/table]


and that's it.

Not very helpful.... :(

Share this post


Link to post
Share on other sites

Thank you.

It looks hard to do it without a real table only with codes if u know what i mean :lol:

So how can i create a table with

3 rows? and 3 columns?

and add content to them? is there a tutorial?

Thanks

Share this post


Link to post
Share on other sites

I wish to use the system for layout purposes only, with two columns, the left containing an image and the right hand side containing text.

For me I'm having a few things ideally I'd like to work around:

1) I need to be able to hide the table title line as it is not needed at all.
2) The column does not seem to fit the entire width of the page it is posted on, it seem to be around 3/4 of the total width?
3) Is there a way of turning off the alternate row colours?
4) There seem to be around two lines of empty space above each table?

The BBCode I'm testing with is as follows:

[/td][td=150]Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum[/td][/tr] [tr][td2]%7Boption%7D [/td2][td2]Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum[/td2][/tr] [/table]

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

[table=Table 1]

[tr][td=10][IMG]		



Any ideas at all?

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.