gpt4 book ai didi

html - table 在中间

转载 作者:行者123 更新时间:2023-11-28 04:01:13 26 4
gpt4 key购买 nike

我需要在页面中间有一个表格,但是我的表格内容像图片一样在右侧。

[编辑]:抱歉,我忘了说只是响应式 tabke 搞砸了你可以在 edastehlik.wz.cz 视口(viewport)上查看它:500 - 1050

Not like this

但我需要这样:

Like this

.tabulkaodesilac {
width: 100%;
margin-left: 400px;
display: block;
}

#jmeno,
#e-mail,
#spam,
#predmet {
border-radius: 50px;
background: rgba(141, 109, 182, 0.75);
width: 350px;
height: 25px;
font-family: Calibri;
font-size: 16px;
color: white;
padding: 0 10px;
border-style: none;
}

@media screen and (max-width: 1050px) {
.tabulkaodesilac {
padding: 0px;
margin-bottom: 10px;
position: relative;
width: 100%;
margin: 0 auto;
}
#jmeno,
#e-mail,
#spam,
#predmet {
width: 70%;
font-family: verdana;
margin-left: 10px;
display: block;
margin: 0 auto;
}
}
<table class="tabulkaodesilac">
<tr>
<td><input id="jmeno" type="text" name="jmeno" placeholder="Vaše Jméno" /> <br></td>
<td><input id="e-mail" type="email" name="email" placeholder="Váš E-mail" /><br></td>
</tr>
<tr>
<td><input id="spam" type="text" name="spam" placeholder="Zadejte aktuální rok" /><br></td>
<td><input id="predmet" type="text" name="predmet" placeholder="Předmět" /> <br></td>
</tr>
</table>

最佳答案

您可以为您的表格指定 margin: 0 auto 并从那里删除其他内容:

.tabulkaodesilac {
margin: 0 auto;
}

#jmeno,
#e-mail,
#spam,
#predmet {
border-radius: 50px;
background: rgba(141, 109, 182, 0.75);
width: 350px;
height: 25px;
font-family: Calibri;
font-size: 16px;
color: white;
padding: 0 10px;
border-style: none;
}

@media screen and (max-width: 1050px) {
.tabulkaodesilac {
padding: 0px;
margin-bottom: 10px;
position: relative;
width: 100%;
margin: 0 auto;
}
#jmeno,
#e-mail,
#spam,
#predmet {
width: 70%;
font-family: verdana;
margin-left: 10px;
display: block;
margin: 0 auto;
}
}
<table class="tabulkaodesilac">
<tr>
<td><input id="jmeno" type="text" name="jmeno" placeholder="Vaše Jméno" /> <br></td>
<td><input id="e-mail" type="email" name="email" placeholder="Váš E-mail" /><br></td>
</tr>
<tr>
<td><input id="spam" type="text" name="spam" placeholder="Zadejte aktuální rok" /><br></td>
<td><input id="predmet" type="text" name="predmet" placeholder="Předmět" /> <br></td>
</tr>
</table>

关于html - table 在中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43195175/

26 4 0