如何获得宽度我设置表格和TD等是我设置它们的大小? [英] How to get width I set tables and TD's etc. to be the size I set them?

查看:68
本文介绍了如何获得宽度我设置表格和TD等是我设置它们的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我真的需要一些桌面帮助,每次我做一个网站时,我发现自己浪费了几个小时和几个小时,这次也没有什么不同。我正在进入小时10试图让它工作。


我只想在表格中设置的宽度和TD'等等我设置它们的大小。我的桌子宽850px,有12个TD'或TH',各种尺寸从40px到150px。这也必须考虑到1px边框和可能的填充,但是那个让我感到困惑。


如果有人可以告诉我一种方法来成功地做到这一点那将是很好的,因为我我只是没有运气。


我也应该提到我不希望TD'根据内容缩小或扩大。我希望他们保持为他们规划的大小。如果它需要换行到下一行,我可以接受它。


我已经在下面发布了我的代码和CSS,但我更喜欢新的输入,如何做到这一点,而不是一个米老鼠修复我所做的那些不起作用的东西,因为我确信在我完成所有改变之后它正好吃午饭。


感谢您的帮助


表格代码

Hi All,

I really need some help with tables, each time I do a site I find myself wasting hours and hours on end, and this time is no different. I am into hour 10 trying to get this to work.

I just want the widths I set in my table and TD''s etc. to be the size I set them. My table is 850px wide, with 12 TD''s or TH''s being various sizes from 40px to 150px. This also has to take into account the 1px borders and possibly the padding, but that one confuses me.

If someone can show me a way to do this successfully that would be great as I am just having no luck.

I should mention too that I do not want the TD''s shrinking or expanding based on content. I want them to stay the size that is laid out for them. If it needs to wrap to the next line, I can live with that.

I have posted my code and CSS below, but I would prefer fresh input of how to do this, not a mickey mouse fix of what I have done that doesn''t work, as I am sure it is right out to lunch after all the changes I have done.

Thanks for the help

Table Code

展开 | 选择 | Wrap | 行号

推荐答案

有人吗?这是非常时间敏感的,任何帮助都表示赞赏。
Anyone? This is quite time sensitive and any help is appreciated.


不确定浏览器支持的程度,但你应该查看< col> &安培; < COLGROUP>元素。
not sure how far the browser support is, but you should look into the <col> & <colgroup> elements.


乍一看:宽度应该在< td>上。而不是在div上。


如果我们能看到代码在运行中,我们就更容易调试。有在线示例吗?
At first glance: the width should be on the <td> and not on the div.

Its easier for us to debug if we can see the code in action. Is there a online example?


这篇关于如何获得宽度我设置表格和TD等是我设置它们的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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