The length of the character is different, how to calculate the width?

character length is different, how to calculate the width

clipboard.png

A width is required for better-scroll initialization, but the length of each string is different. How to calculate the width like it

Mar.06,2021

there has been a similar requirement before, and it was solved like this at first:

JS dynamically generates the element node, then inserts the string into it, and then looks at the width of this element, such as $('.test'). Width () ;

of jQuery ).

later found a simpler solution (a few lines of CSS). (unlike your needs, telling you that the solution is not applicable)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb035f-4f78a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb035f-4f78a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?