Html 哪个选项将自动增加/减少div中表格的高度

Html 哪个选项将自动增加/减少div中表格的高度,html,css,button,html-table,Html,Css,Button,Html Table,请帮帮我!我的网站的菜单与此菜单相似 在此菜单中: width: 30%; margin-left: -25%; height: 98%; background:#ffab23; position: fixed; top: 1%; bottom: 1%; z-index: 1; border-radius:15px; 包含一个表,表中有一列和多行,每行中有一个按钮 如何使表格作为菜单自动增加/减少 菜单的一部分: <div id="menu" align="left" style="di

请帮帮我!我的网站的菜单与此菜单相似

在此菜单中:

width: 30%;
margin-left: -25%;
height: 98%;
background:#ffab23;
position: fixed;
top: 1%;
bottom: 1%;
z-index: 1;
border-radius:15px;
包含一个表,表中有一列和多行,每行中有一个按钮

如何使表格作为菜单自动增加/减少

菜单的一部分:

<div id="menu" align="left" style="direction:rtl; overflow:auto;">
<div style="direction:ltr;">
<table height="100" width="80%" align="left">
    <tr>
    <td>
    <a href="#introducere" class="myButton">1. INTRODUCERE</a>
    </td>
    </tr>...

如果您想自动增加/减少高度,只需使用
height:auto
,如果您想增加/减少宽度,则使用
width:auto


看到按钮,当您输入一个长文本时,它就会显示。

将其高度设置为
auto
。我为菜单左侧的滚动条和我想要的停止点设置了:style=“direction:rtl;overflow:auto;”>。如果我将删除此选项,一切都很好。对不起,我的英语…对不起,我没听懂你的话。你到底想要什么?你能用jsfiddle或其他语言展示一些例子吗?
.myButton {
-moz-box-shadow:inset 0px 0px 3px 3px #caefab;
-webkit-box-shadow:inset 0px 0px 3px 3px #caefab;
box-shadow:inset 0px 0px 3px 3px #caefab;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #77d42a), color-stop(1, #5cb811) );
background:-moz-linear-gradient( center top, #77d42a 5%, #5cb811 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#77d42a', endColorstr='#5cb811');
background-color:#77d42a;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #268a16;
display:inline-block;
color:#306108;
font-family:calibri;
font-size:15px;
font-weight:bold;
padding:2% 24px;
text-decoration:none;
text-shadow:2px 2px 2px #aade7c;
width:79%;}


.myButton:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #5cb811), color-stop(1, #77d42a) );
background:-moz-linear-gradient( center top, #5cb811 5%, #77d42a 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5cb811', endColorstr='#77d42a');
background-color:#5cb811;}


.myButton:active { position:relative; top:1px; }