Line breaks in Tables
Forum » Help / Editing pages » Line breaks in Tables
started by: pcd84pcd84
on: 1211247255|%e %b %Y, %H:%M %Z|agohover
number of posts: 5
rss icon RSS: new posts
Line breaks in Tables
pcd84pcd84 1211247255|%e %b %Y, %H:%M %Z|agohover

I'm trying to nest tables, and I need them to fit tightly into one another. Is there any way to eliminate the line break <\br> before tables? They always have a space above….

unfold Line breaks in Tables by pcd84pcd84, 1211247255|%e %b %Y, %H:%M %Z|agohover
Re: Line breaks in Tables
Craig MacomberCraig Macomber 1211248751|%e %b %Y, %H:%M %Z|agohover

That space may be the table's margin which can be adjusted in the CSS theme.

unfold Re: Line breaks in Tables by Craig MacomberCraig Macomber, 1211248751|%e %b %Y, %H:%M %Z|agohover
Re: Line breaks in Tables
pcd84pcd84 1211283024|%e %b %Y, %H:%M %Z|agohover

That's what I had read, but I still have the problem. This code:

+++ A Basic Nested Table

//text above (A)//
[[table style="margin: 0 0 0 0px; padding: 0px; width: 8cm; background-color: red"]]
  [[row]]
    [[cell style="width: 25%"]]**Left cell**[[/cell]]
    [[cell style="width: 75%"]]text above the nested table
      [[table style="margin: 0 0 0 0px; padding: 0px; width: 100%; background-color: orange"]]
        [[row]]
          [[cell style="width: 50%"]]Left cell[[/cell]]
          [[cell style="width: 50%"]]Right cell[[/cell]]
        [[/row]]
      [[/table]]text below the nested table
    [[/cell]]
  [[/row]]
[[/table]]
//text below (B)//

…produces this:

A Basic Nested Table

text above (A)


Left cell

text above the nested table


Left cell Right cell

text below the nested table

text below (B)

What causes the extra space above the red and orange tables?

unfold Re: Line breaks in Tables by pcd84pcd84, 1211283024|%e %b %Y, %H:%M %Z|agohover
Re: Line breaks in Tables
ErichSteinboeckErichSteinboeck 1211306487|%e %b %Y, %H:%M %Z|agohover

> What causes the extra space above the red and orange tables?

1. A smaller part of the problem is the leading spaces in front of the [[row]] tag, which the Wikidot parser doesn't like. Remove it, and there's a little less extra space.

text above (A)


Left cell

text above the nested table

Left cell Right cell

text below the nested table

text below (B)

2. The larger part of the problem is the fact that the Wikidot parser generates <p>..</p> tags surrounding the “text above/below the nested table” strings if you nest a table in the same cell. It doesn't do this, if you don't nest a table (i. e. could be a bug in the parser).

A solution for you could be to put any nested tables in their own cells with no other text in the same cell. To achieve this you could e. g. instead of putting

  • text above the nested table
  • nested table
  • text below the nested table

in one cell, define another nested table for those three items and put each one in its own cell, that is define

  • a table that has
    • a row with a single cell containing: “text above the nested table”
    • another row with a single cell containing: your (orange) nested table
    • another row with a single cell containing: “text below the nested table”

This would like this:

text above (A)


Left cell
text above the nested table
Left cell Right cell
text below the nested table

text below (B)

The same idea applies if you want to remove the extra space between “text above/below (A/B)” and the red table (i. e. put those three in a table with each element in its own cell).

unfold Re: Line breaks in Tables by ErichSteinboeckErichSteinboeck, 1211306487|%e %b %Y, %H:%M %Z|agohover
Re: Line breaks in Tables
pcd84pcd84 1211315951|%e %b %Y, %H:%M %Z|agohover

I think this will work for me. Thanks a bunch!

unfold Re: Line breaks in Tables by pcd84pcd84, 1211315951|%e %b %Y, %H:%M %Z|agohover
new post
Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.