Skip to content
achimmihca edited this page Jan 7, 2021 · 4 revisions

Margins do not work on all elements and all nestings.

  • margin-bottom works on divs
  • maring-left woks on divs, tables

Margins on Tables

You can use margin-left on tables directly: <table style="margin-left: 30mm;">...</table>.
But it might not work when the table is inside a div with margin-left: <div style="margin-left: 30mm;"><table>...</table></div>.

To separate two tables vertically, put a div with margin-bottom between the tables:

    <table style="margin-left: 30mm;">
        <tbody>
            <tr>
                <td>Table1Cell1</td>
                <td>Table1Cell2</td>
                <td>Table1Cell3</td>
            </tr>
        </tbody>
    </table>

    <div style="margin-bottom: 50mm">
    </div>

    <table>
        <tbody>
            <tr>
                <td>Table2Cell1</td>
                <td>Table2Cell2</td>
                <td>Table2Cell3</td>
            </tr>
        </tbody>
    </table>

Margins on Images

It works when wrapping the img-element inside a div:

    <div style="margin-bottom: 50mm; margin-left: 35mm;">
        <img src="theImage.png" alt="image"/>
    </div>
Clone this wiki locally