Setting table width, margin

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Shredder
Propeller Head
Posts: 43
Joined: Fri Sep 18, 2020 4:42 am

Setting table width, margin

Post by Shredder »

Hi folks,

I am creating the layout rules for our print output. The autonumbered headings have a padding-left of 20 mm. To align with the headings, the <p> has a 20 mm margin-left. However, I am not able to give the tables a margin-left of 20 mm.

Unfortunately, I am a bit stuck with the table styles. I have several different table styles. All tables must have a margin-left of 20mm, too. For the table style in the screenshot, I reduced the width to 80% and set a margin-left: 20mm in the stylesheet (not the table style!):

table.TasksTable
{
display: block;
width: 80mm;
margin-left: 20mm;
}

Alas, the table is stuck across the whole width of the page.

What am I doing wrong?

Thanks for your help!
You do not have the required permissions to view the files attached to this post.
Shredder
Propeller Head
Posts: 43
Joined: Fri Sep 18, 2020 4:42 am

Re: Setting table width, margin

Post by Shredder »

I solved it meanwhile:

table
{
width: 87%; /* still need to calculate the correct percentage, but this works well */
margin-left: 20mm;
float: right;
}
robdocsmith
Sr. Propeller Head
Posts: 247
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Setting table width, margin

Post by robdocsmith »

As you probably discovered, it's the display: block; statement that causes the content to fill the width of the text frame, no matter what other left or right margin settings are supplied.

So:

Code: Select all

table
{
width: 80mm;
margin-left: 20mm;
}
will also work and will align right if the text frame is 100mm wide.
Post Reply