The implementation method of adding a horizontal scroll bar to a table in JSP _jsp programming

Source: Internet
Author: User

First, the bootstrap framework is used in this project, so some people will say that it's OK to set adaptive properties on the table.

The point here is to affirm

Bootsrtap Adaptive is the horizontal scroll bar that appears when the browser does not fill the entire screen, but half the time.

And when we maximize the browser, what happens when the number of columns increases?

The answer is that there will be extrusion effect, and the scroll bar will not appear horizontally

See the tutorials on the web, many people say what the parent div settings 100%,table Add scrool properties are not

Here, the solution is simple, set the properties of the <th> tag, so that it does not automatically wrap

$ (document). Ready (function () { 
 
    $ ("th"). CSS ("White-space", "nowrap"); 
}); 

To set the property that the th label does not allow line wrapping after the page load completes

Note that this property is used in CSS and is not used in the th tag, as follows

<th nowrap= "nowrap" > can also be implemented without automatic line wrapping

The above is a small series for everyone to bring the JSP for the table to add a horizontal scroll bar implementation of the full content, I hope that we support cloud Habitat Community ~

Related Article

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.