Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to change the column width by dragging the table header in jquery

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "jquery how to drag and drop the table header to change the column width". The content in the article is simple and clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how to drag and drop the table header to change the column width".

Effect:

Go directly to the code and have comments:

Table, td, th {border: 1px solid # ddd; text-align: left;} table {border-collapse: collapse; width: 100%; table-layout: fixed;} th, td {padding: 5px; position: relative; user-select: none / * text-overflow: ellipsis;*/ word-break: break-all;}. Th-sisehandler {position: absolute; right:-0.5px; top: 0; z-index: 1; width: 5px; height: 100%; padding-left: 4px Cursor: col-resize;}. Th-sisehandler::after {content:'; display: block; width: 10px; background-color: # 4CAF50; / * demonstration to see the effect, you can remove * / height: 100%;} .siselayer {position: fixed Left: 0; top: 0; right: 0; bottom: 0; z-index: 9999; background-color: # 4445a049; / * in order to see the effect, remove * / cursor: col-resize } Firstname Lastname Savings Bill Gates $100 Steve Jobs $150 Elon Musk $300 Mark Zuckerberg $250 ("th") .mouseover (function (e) {if (($(this). Find ("div"). Length

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 279

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report