How to Auto resize HTML table cell to fit the text size

前端 未结 3 1579
北海茫月
北海茫月 2020-12-05 06:28

I have a table with 2 rows and variable columns. I tried width = 100% for the column. So the first content in the view will fit. But suppose if i am changing the contents dy

3条回答
  •  旧时难觅i
    2020-12-05 06:47

    If you want the cells to resize depending on the content, then you must not specify a width to the table, the rows, or the cells.

    If you don't want word wrap, assign the CSS style white-space: nowrap to the cells.

提交回复
热议问题