Html table fixed column width

Html Table tr td


We often know where the table html td will follow a string of words inside the widening stretch

Therefore, we can set up a table in the table-layout in css: fixed;

And word-wrap: break-word; if it is to have the English word field width can automatically break the boundary line

 /*整个table的调整*/
   table{
   	border-collapse: collapse;
   	width: 770px; 	
   	/*自动断行*/
   	word-wrap: break-word;
   	table-layout: fixed;
   }

However, I also encountered a problem this is my form long as this figure


The following is not the number of three storage cells, but does not want to save the number of cells below a first relatively long, the shorter rear

But when we finished on top of the layout: the fixed, we will find that he can not be adjusted and monospaced

Solution :


   

要在上方先建立一个空白表格,并调整宽度再将他hidden即可调整

原文:大专栏  Html 表格固定栏宽


posted on 2019-09-09 10:01 wellwill 阅读(...) 评论(...) 编辑 收藏

导航

xxx xxx

Guess you like

Origin www.cnblogs.com/petewell/p/11490065.html