mpdf / mpdf

PHP library generating PDF files from UTF-8 encoded HTML
https://mpdf.github.io
GNU General Public License v2.0
4.4k stars 1.07k forks source link

Indent ol not working inside table #346

Open gavnyx opened 7 years ago

gavnyx commented 7 years ago

I have this problem

I want to use ol li inside table but li indent is not working. ol li indent is working well if not inside table. Can someone help me with this issue ? Thank u before...

These are mPDF and PHP versions I am using

Mpdf : 6.1.3 PHP : 5.5.33

This is a HTML code snippet I use

<table>
    <tr><td>
    <ol>
        <li>very long char.....</li>
    </ol>
    </td></tr>
<table>

Result html above

1. very long char...
continue here....    **<-- indent not working (inside <td> tag)**
and here...
2. very long char...
continue here....
and here...

Expectation

1. very long char
   continue here... <-- **indent working**
   and here,,,
2. very long char
   continue here...
   and here,,,
ediharyono commented 5 years ago

This same problem with my project. I need result is a, b, c, etc. in the list, but result is 1, 2, 3, etc.

ediharyono commented 5 years ago

So I give the table include table td.

a.very long car... continue here.
b.very long car... continue here.
So this only solution. I haven't better solution.
chanakacstv commented 5 years ago

@ediharyono How did you do this...?

jengrace commented 5 years ago

I'm also experiencing this issue where <ul> <li> </li> </ul> lists inside of tables don't indent properly for text that wraps around to the next line. Thanks.

dobrinea commented 4 years ago

Ol -> list-style-position not working in table. How can I resolve it?

fliix-de commented 2 years ago

Same issue still today in 2022. We can't change the "ol" type inside a table.

finwe commented 2 years ago

@fliix-de you are more than welcome to implement a fix and propose a pull request.

moreover, this is documented: all block-level elements css, including margins and paddings is ignored inside tables. https://mpdf.github.io/tables/tables.html

moreover, it seems you are off-topic here, this issue is about indents, not list-style-type.

Ziggizag commented 8 months ago

@finwe

Hi!

Can you give us any clue about the reason for this nasty limitation affecting block-level elements styles? This is very annoying, and it has deep conseqences for layout design.

I know this is documented with a single paragraph, but some basic explanation would be very helpful, IMHO.

Rgs,

finwe commented 8 months ago

@Ziggizag your clue about the reason for this nasty limitation is right in the readme of the project: https://github.com/mpdf/mpdf/blob/development/README.md#about-css-support-and-development-state

finwe commented 8 months ago

@Ziggizag And as always, you are more than welcome to implement a fix and propose a pull request.