About the effect of using Div to implement table

Source: Internet
Author: User
During this time, the Gantt chart is implemented. First, a 2x2 table layout is used. Fill in four divs in the table to display the scroll bars of the X and Y coordinates in the lower right corner, implement the synchronization of the scroll bars of the DIV in the upper right and lower left respectively, and control the width with percentages, so that the width of the DIV cannot be controlled. Fortunately, we can use Div to replace the table layout. I will share the basic code with you. <Div id = "Main" style = "border: 1px dashed # CCC; width: 100%;">
<Div class = "row" style = "margin: 4px;">
<Div class = "Left" id = "div1" style = "float: Left; margin-Right: 4px; Background: red; Height: 100px; width: 20%;">
</Div>
<Div class = "right" id = "div2" style = "OVERFLOW-X: hidden; VERFLOW-Y: hidden; Background: Blue; Height: 100px; width: 75%;">
</Div>
</Div>
<Div class = "row" id = "div3" style = "margin: 4px;">
<Div class = "Left" style = "OVERFLOW-X: hidden; VERFLOW-Y: hidden; float: Left; margin-Right: 4px;

Background: red; Height: 100px; width: 20%; ">
</Div>
<Div class = "right" id = "div4" onscroll = "document. getelementbyid ('div2'). scrollleft =

This. scrollleft; document. getelementbyid ('did3'). scrolltop = This. scrolltop; "style =" OVERFLOW-X: Scroll; overflow-

Y: Scroll; Background: Blue; Height: 100px; width: 75%; ">
</Div>
</Div>
</Div>

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.