PD4ML v4 Forums PD4ML v3 Archived Forums (Read Only) HTML/CSS rendering issues margin-left:auto margin-right:auto not working

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #26759

    I have a simple table with the following style sheet.

    .CenterDiv
    {
    margin-left:auto;
    margin-right:auto;
    }

    It centers properly in HTML but stays left aligned when exported to PDF.
    What is wrong? Is this CSS supported?

    Thanks in advance,
    Clifton Sothoron

    #29077

    The CSS properties are not supported by PD4ML.

    For tables there is a non-standard workaround:

    [language=css:ilomyxlf]@media pdf {
    table.CenterDiv {
    align:center;
    }
    }[/language:ilomyxlf]

    #29078

    Thank you for replying. I modified my .CSS file to include the following. The PDF output did not change. Is there something else?

    Best,
    Clif…

    @media pdf {
    table.CenterDiv {
    align:center;
    }
    }
    .CenterDiv
    {
    margin-left:auto;
    margin-right:auto;
    }

    #29079

    Do you need to center a TABLE or a DIV?

    #29080

    It’s a table under a DIV. I’ve tried setting the class on the Body, Div and Table and can’t make it center.

    Best,
    Clif…

    #29081

    What about to enclose the table to

    and
    tags?

    #29082

    I need to control this using CSS.

    Best,
    Clif…

    #29083

    Our application is a general purpose tool that generates HTML pages. Formatting is controlled using CSS. Changing the HTML to insert a CENTER tag to center a table is not going to happen. CSS was invented to solve simple problems like this.

    The W3C documentation says the following.
    The

    tag is supported in all major browsers. However, it is deprecated and should be avoided!

    Do you have a CSS solution for centering a table that will work with your tool?

    Best,
    Clifton Sothoron

    #29084

    For the time being an applying of “align:center” to a table is the only way to center it with PD4ML (however the method is not standard).

    If it does not center, probably the hosting DIV has limited width. Try to apply “width:100%” to it. Also a temporal style like “DIV { border: 1 solid tomato }” should help you to identify reasons of the non-centering.

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.