Jump to content

[HSC] Table BBCode


HeadStand
 Share

Recommended Posts

%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

Link to comment
Share on other sites

  • 3 weeks later...

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.

Link to comment
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.

Link to comment
Share on other sites

  • 3 weeks later...

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.

Link to comment
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 :(

Link to comment
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.
Link to comment
Share on other sites

  • 3 weeks later...

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.
Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

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.... :(

Link to comment
Share on other sites

  • 2 weeks later...

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...