Empty line before UL list

Help
Paul
2012-03-14
2014-05-12
  • Paul

    Paul - 2012-03-14

    Hello,
    i have problem with empty line (or gap) above every unordered list (UL).

    My html code is:

    Header<br/>
    <ul>
    <li>Some text</li>
    <li>Another text</li>
    </ul>
    

    I would like to have

    Header
    - Some text
    - Another text
    

    But TCPDF generate

    Header
    //empty line
    - Some text
    - Another text
    

    I have tried

    $tagvs = array('ul' => array(0 => array('h' => '', 'n' => 0), 1 => array('h' => '', 'n' => 0)),
                'ol' => array(0 => array('h' => '', 'n' => 0), 1 => array('h' => '', 'n' => 0)),
            );
    $pdf->setHtmlVSpace($tagvs);
    

    this make the gap smaller, but still is there and looks like empty line.

    Is there any solution how to remove the gap completly?

     
  • Nicola Asuni

    Nicola Asuni - 2012-03-14

    The following code seems working fine:

    $html = "hello<ul><li>world</li></ul>";
    $tagvs = array('ul' => array(0 => array('h' => '', 'n' => 0), 1 => array('h'=> '', 'n' => 0)), 'ol' => array(0 => array('h' => '', 'n' => 0), 1 => array('h' =>'', 'n' => 0)));
    $pdf->setHtmlVSpace($tagvs);
    

    Be sure you are using the latest TCPDF version and remove the
    before
    the first line.

     
  • mithrandil

    mithrandil - 2014-05-09

    I know it's an old tread, but it's still true, if you use

    <h1>Header</h1><ul><li>Some text</li><li>Another text</li</ul>
    

    you obtain

    Header
    //empty line
    - Some text
    - Another text
    

    which is wrong, how to fix it?

     
    Last edit: mithrandil 2014-05-09
  • Nicola Asuni

    Nicola Asuni - 2014-05-09

    This is the wanted behaviour and it happens to be the same behaviour as standard HTML.

    To remove/adjust vertical spaces, please check the tips in the example 61.

     
  • mithrandil

    mithrandil - 2014-05-12

    actually it's not the standard HTML behavior, as you can see in this example:

    http://i58.tinypic.com/28ai1sm.jpg

    • the distance between the H1 and the first element in the UL is NOT affected by the presence of the txttttttttt
    • I'm not able to further reduce the distance between the H1 and the first element of the list
      • I already set 'h'=0 and 'n'=0 for both UL and H1
      • if I set 'h'=0 and 'n'=0 for LIs they will overlap

    Any idea how to overcome this and reduce the space between the H1 and the first element of the UL?

    Thank You

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks