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!
Setting table width, margin
Setting table width, margin
You do not have the required permissions to view the files attached to this post.
Re: Setting table width, margin
I solved it meanwhile:
table
{
width: 87%; /* still need to calculate the correct percentage, but this works well */
margin-left: 20mm;
float: right;
}
table
{
width: 87%; /* still need to calculate the correct percentage, but this works well */
margin-left: 20mm;
float: right;
}
-
- Sr. Propeller Head
- Posts: 248
- Joined: Thu May 24, 2018 3:11 pm
- Location: Queensland, Australia
Re: Setting table width, margin
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:
will also work and will align right if the text frame is 100mm wide.
So:
Code: Select all
table
{
width: 80mm;
margin-left: 20mm;
}