在下面的照片中,有一個div,其中有一個包含一些內容的表格,當我重新縮放Web瀏覽器的頁面時,該表格不在div中。基於網頁大小的縮放表
我希望做的是使表更小,當它重新定標,仍然顯示一切這是它的內部,而無需使用滾動條或類似的東西的。
編輯
#profileTable{
\t width:auto;
\t text-align:left;
\t color:#000080;
\t padding:30px 60px;
\t border:1px solid #ccc;
\t border-radius:4px;
\t background-color:white;
\t margin: 0 50px 50px;
}
#content{
\t margin: 0px 60px 0px;
\t background-color:#E9E9E9;
\t border:solid 1px grey;
\t flex: 1;
\t clear:both;
\t position:relative;
}
<html>
<head>
</head>
<body>
<div id="content" >
<h2><center>Your profile</center></h2> \t \t \t \t \t
<table id="profileTable">
<tr> \t \t \t \t \t \t \t
<th>Username:</th> \t \t \t \t
<td>CONTENT</td>
</tr>
<tr> \t \t \t \t \t \t \t
<th>First name:</th> \t \t \t \t
<td>CONTENT</td>
</tr>
</table>
</div>
</body>
</html>
添加HTML,CSS在這個問題。 –
'table {width:XX%; table-layout:fixed;}'https://www.w3.org/wiki/CSS/Properties/table-layout如果內容不需要表格,則使用常規標籤 –
有沒有一個HTML表或沒有?哪個標籤是CSS相關的?中心是一個過時的標籤,因爲很久以前,不要使用它:( –