Structure of PHP (Html) + Css implementation

Source: Internet
Author: User
There are a lot of open-source js version organization chart tools on the Internet, but suppose there is such a scenario, there is an xml file of more than 10 MB, which contains organizational relationships, which should be parsed using php, to generate JavaScript, these two processes are very time-consuming. Especially in js rendering, most js versions are used to generate Divs, which is certainly slower. My method is,

There are a lot of open-source js version organization chart tools on the Internet, but suppose there is such a scenario, there is an xml file of more than 10 MB, which contains organizational relationships, which should be parsed using php, to generate js again, these two processes are very time-consuming. In particular, the js rendering process, most js versions all generate p again, which will certainly be even slower. My method is,

There are a lot of open-source js version organization chart tools on the Internet, but suppose there is such a scenario, there is an xml file of more than 10 MB, which contains organizational relationships, which should be parsed using php, to generate js again, these two processes are very time-consuming. In particular, the js rendering process, most js versions all generate p again, which will certainly be even slower.

My method is to directly use php to output a corresponding html structure. I use a table with a certain structure and then use css to draw lines. The specific implementation method is OK by directly looking at the code. If you have any questions, you can discuss them. PHP-to-OrgChart
 ';        $size=count($arr);        if($title!='') {            //head            echo '';            echo '';            echo '

'.$title.'

'; echo ''; echo ''; //head line echo ''; echo ''; echo '
'; echo ''; echo ''; //line if($size>=2){ $tdWidth=((100)/($size*2)); echo ''; echo ''; echo ''; for($j=1; $j<$size-1; $j++) { echo ''; echo ''; } echo ''; echo ''; echo ''; } } // echo ''; foreach($arr as $key=>$value) { echo ''; if(is_array($value)) { PHPtoOrgChart($value,$key); } else { echo '

'.$value.'

'; } echo ''; } echo ''; // echo ''; }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.