简体   繁体   English

HTML表格单元格大小(或适合其内容的单元格高度)

[英]Html table cell size (or cell height that fits its content)

I want to put 3 vertical options in a listview. 我想在列表视图中放置3个垂直选项。 I use a table to accomplish that but only 2 options are visible so I need to compress the cell height. 我使用一张表来完成此操作,但是只有2个选项可见,因此我需要压缩单元格高度。 You can see in the picture that there is a free space in each cell. 您可以在图片中看到每个单元中都有可用空间。

在此处输入图片说明

I've tried some td options like height but no succeded. 我尝试了一些td选项,例如height,但是没有成功。 Can I use some other html control, maybe a list, to get what i want? 我可以使用其他HTML控件(也许是列表)来获取我想要的吗? am. 上午。

Since you are using a table to create the vertical options, the best you can do to compress the height (besides using smaller font, of course) is to set the cell padding and cell spacing to something small: 由于您使用表格来创建垂直选项,因此最好的做法是压缩高度(当然,使用较小的字体)是将单元格填充和单元格间距设置为较小:

<table cellpadding="1" cellspacing="1">
<tr> 
   etc...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM