The page has 3 wraps, and each wrap has 3 boxes.
They are yellow box in the left, pink box in the center, and yellowGreen box in the right.
The center box in pink is not spreaded enough in wrap1.
The center box in pink is spreaded enough but the text in yellow box is falled in wrap2.
The center box in pink is spreaded enough and the text in yellow box is not falled in wrap3.
This is what I want.
But if you look closely,
you will find the text in yellow box has not any breaks.
How can I make it looks like the wrap3 with some breaks in text which is in the yellow box?
I want the yellow box in the left and the yellowGreen box in the right are automatically fitted by the text in the box.
and the pink box in the center is fully spread to all the rest…
When using display table, by default, the widths will depend on the content, as in the top example. If the pink box had wider content, it would expand to contain it.
In the middle and bottom examples, the problem you have is that you set the pink box to 100% width. This pushes the others to a minimum. You can set specific widths, but using %, but the total must not exceed 100. Eg, yellow could be 30%, pink 50% and green 20%. Though you could define only 1 or 2 of them, as the others would take the space left over and avoid a mis-calculation.
Make it less than 100%, Eg, 40 or 50%, whatever proportion you want. 100% is the full width, so leaves no spare space for the other two, that is making them cramped.
The only way you can do this without sizing the outer columns is to add white-space:nowrap to the outer cell columns. Keep the width:100% on the middle column to keep it as wide as possible.
Of course it depends on what the real data is going to look like. If you want the outer cells to contain wrapping text then you will have to give them a width as Sam has shown above.
For modern browsers flexbox makes this easy.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
#wrap2{display:flex;border:1px solid #000;}
.left,.right{background:yellow}
.mid{background:pink;text-align:center;flex:1}
.left,.right,.mid{padding:10px;}
</style>
</head>
<body>
<div id="wrap2">
<div class="left">Text in yellow box.<br>
Text in yellow box. </div>
<div class="mid">center</div>
<div class="right">Text in Yellow box.</div>
</div>
</body>
</html>