Setting table width, margin

This forum is for all Flare issues related to styles, stylesheets and XML.

Setting table width, margin

Postby Shredder on Mon Apr 19, 2021 3:52 am

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: 18
Joined: Fri Sep 18, 2020 4:42 am

Re: Setting table width, margin

Postby Shredder on Mon Apr 19, 2021 5:50 am

I solved it meanwhile:

table
{
width: 87%; /* still need to calculate the correct percentage, but this works well */
margin-left: 20mm;
float: right;
}
Shredder
Propeller Head
 
Posts: 18
Joined: Fri Sep 18, 2020 4:42 am

Re: Setting table width, margin

Postby robdocsmith on Mon Apr 19, 2021 5:06 pm

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.
robdocsmith
Sr. Propeller Head
 
Posts: 119
Joined: Thu May 24, 2018 3:11 pm


Return to Styles, Stylesheets and XML

Who is online

Users browsing this forum: No registered users and 8 guests