The method of adding a horizontal scroll bar to a table in jsp is as follows:
First, the bootstrap framework is used in this project, so some people will say that you can set the adaptive attribute for the table.
Which of the following statements is true?
The adaptive bootsrtap is used to display a horizontal scroll bar when the browser is not full but half of the screen.
What if the number of columns increases when we maximize the number of browsers? What will happen?
The answer is the squeeze effect, and the scroll bar does not appear in the horizontal direction.
Looking at the tutorials on the Internet, many people say that the parent div is set to 100%, and the scrool attribute cannot be added to the table.
Here, the solution is simple. Set the attribute of the <th> label so that it does not wrap automatically.
$ (Document). ready (function () {$ ("th" ).css ("white-space", "nowrap ");});
To set the attributes that the th tag does not allow to wrap automatically after page loading.
Note that this attribute is used in css, which is different from that used in the th tag. the method used in the th tag is as follows:
<Th nowrap = "nowrap"> You can also disable automatic line feed.
The above is all the content of the jsp method used to add horizontal scroll bars to tables. I hope it will be helpful to you and provide more support for the help house ~