The minimum column width of the first table

is there any way for the left, first column to have a minimum width ...... like 50%.

I have a different number of separate tables (with different headers, so they are separate pieces of data).

Obviously, a table column changes its width depending on how much content is inside them ... if it needs extra space, then more space from other columns in one table will be needed ... it's cool, but when there is a lot of space and it doesn’t need extra space, then its a lot tidier if they all remain the same width ... for example, 50%

http://jsfiddle.net/mqatP/5/

Any idea how to do this without testing in PHP, how much content goes inside them and adding different classes?

Thanks Dom

+6
source share
3 answers

I was surprised to learn that min-width does not do the trick. However, after playing with him for a while, I came across this solution:

 td:first-child { width: 40%; white-space: nowrap; } 
+5
source

I suggest you try this to fix css table width

  table-layout:fixed; 

and in JavaScript syntax: object.style.tableLayout="fixed"

+2
source

you can use

 tbody>tr>td:nth-child(1), tbody>tr>td:nth-child(2), tbody>tr>td:nth-child(3) { width: 50%; } 
+1
source

Source: https://habr.com/ru/post/905532/


All Articles