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….
That space may be the table's margin which can be adjusted in the CSS theme.
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
text below the nested table |
text below (B)
What causes the extra space above the red and orange tables?
> 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
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 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).
I think this will work for me. Thanks a bunch!