将表格列宽调整为内容大小 [英] Adjust table column width to content size

查看:109
本文介绍了将表格列宽调整为内容大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

表单(用firebug突出显示悬停td):





标签列CSS

  width:auto; 
padding:0;
margin:0;

问题



为什么我的左列有那个看不见的padding-right?




- EDIT -

问题是表本身。我用width:100%定义表。删除它,问题消失了。

解决方案

问题是表宽。我对表使用了 width:100%。移除宽度标记后,表格栏会自动调整。


Form (with firebug highlight hover the td):

Label column CSS:

width: auto;
padding: 0;
margin: 0;

The problem:

Why my left columns have that invisible "padding-right"? It's not possible to shrink columns to fit their content?

--EDIT--

The problem was the table itself. I defined table with "width: 100%". Removed that and the problem is gone.

解决方案

The problem was the table width. I had used width: 100% for the table. The table columns are adjusted automatically after removing the width tag.

这篇关于将表格列宽调整为内容大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆