Home > Backend Development > PHP Tutorial > Please tell me about the perfect solution for table column width?

Please tell me about the perfect solution for table column width?

WBOY
Release: 2016-09-08 08:43:57
Original
1398 people have browsed it

Please tell me about the perfect solution for table column width?

As shown in the picture above, there are often N number of data lists in the development system that require the use of tables. Obsessive-compulsive aestheticians want the width of each column of each table to be relatively perfect. Is there a dynamic and perfect solution?

First idea: th or td directly width = '30px'
Second idea: style="width: 30px"
Third idea: define similar common column width classes such as table.id, table.handel, etc.

The first one above is the most undesirable. The second and third ones cannot be set dynamically. There are still many column widths that are not fixed.

Is there a way, such as the id, name, upper-level menu operation, etc. in the above picture, to be the maximum width of the content, and then one of the columns will be filled automatically

Reply content:

Please tell me about the perfect solution for table column width?

As shown in the picture above, there are often N number of data lists in the development system that require the use of tables. Obsessive-compulsive aestheticians want the width of each column of each table to be relatively perfect. Is there a dynamic and perfect solution?

First idea: th or td directly width = '30px'
Second idea: style="width: 30px"
Third idea: define similar common column width classes such as table.id, table.handel, etc.

The first one above is the most undesirable. The second and third ones cannot be set dynamically. There are still many column widths that are not fixed.

Is there a way, such as the id, name, upper-level menu operation, etc. in the above picture, to be the maximum width of the content, and then one of the columns will be filled automatically

Tips, do you just want the style of your stickers, and you also need to ensure your three ideals. So where did your stickers come from? Can't you just refer to the dome you found

Generally, it’s good to adapt, but some fields may have less content and are too long to adapt, so you can only manually write the length. I feel beautiful if I don’t control it as mentioned above. The key is to calculate the field length. You either have to calculate it manually for each table. And this kind of writing cannot be idealized. Sometimes there are more words, and sometimes there are fewer words. And some lines have more words and some have less words

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template