简体   繁体   English

如何对这个 HTML 表的定位进行排序? - 我需要右侧的提交按钮,需要删除左侧的间距

[英]How can I sort the positioning of this HTML Table? - I need the Submit button on the right hand side and need to remove the spacing on the left

I'm just putting together a HTML table for a wix site and for some reason the table is coming out looking all kinds of funky.我只是为 wix 站点整理了一个 HTML 表,出于某种原因,该表看起来很时髦。 There seems to be excessive spacing on the left hand side and the submit button will not position to the right edge of the input boxes?左侧似乎有过多的间距,提交按钮不会 position 到输入框的右边缘? Also, I am trying to change the background colour of the input boxes to '#3A3B3F' but for some reason everything I try is not working, not sure if I have made a fundamental error in the code somewhere.另外,我正在尝试将输入框的背景颜色更改为“#3A3B3F”,但由于某种原因,我尝试的一切都不起作用,不确定我是否在某处的代码中犯了基本错误。 If anyone can provide me with any assistance to this I would be eternally grateful: this is a copy of the tables code and a screengrab of how the table currently looks: Screenshot of table如果有人可以为此提供任何帮助,我将不胜感激:这是表格代码的副本和表格当前外观的屏幕截图:表格截图

<style>
    #crmWebToEntityForm tr , #crmWebToEntityForm td { 
        padding:6px;
        border-spacing:0px;
        border-width:0px;
        }
</style>
<table style='width:600px;background-color:#3A3B3F;background-color:#3A3B3F;color:#3A3B3F'><tr>
<td  colspan='2' align='left' style='color:#ffffff;font-family:Avenir;font:Avenir;font-size:18px;word-break: break-word;'><strong></strong></td>
</tr> <br></br>
  <tr><td  style='word-break: break-word;text-align:left;font-size:16px;font- 
family:Avenir;font:Avenir;width:30%;'><span style='color:red;'></span></td>
  <td style='width:40;' style='height:40px'' ><input type='text' placeholder="First Name" 
style='width:200%; height:50' box-sizing:border-box;'  maxlength='0' name='First Name' /> 
   </td>
    <td style='width:350px; style='height="50px" ></td></tr>
    <tr><td  style='word-break: break-word;text-align:;font-size:16px;font- 
 family:Avenir;font:Avenir;width:350px'><span style='color:red;'></span></td>
 <td style='width:40%;' ><input type='text' placeholder="Last Name" style='width:200%; 
height:50' 'box-sizing:border-box' maxlength='80' name='Last Name' /></td>
    <td style='width:350px; style='height="50px"></td></tr><tr><td  style='word-break: break- 
word;text-align:left;font-size:16px;font-family:Avenir;font:Avenir;width:30%;'><span 
style='color:red;'></span></td>
  <td style='width:40%;' ><input type='text' placeholder="Email Address" 
style='width:200%;height:50''box-sizing:border-box;'  maxlength='100' name='Email' /></td>
    <td style='width:350px; style='height="50px"></td></tr><tr><td  style='word-break: break- 
word;text-align:left;font-size:16px;font-family:Avenir;font:Avenir;width:30%;'><span 
style='color:red;'></span></td>
  <td style='width:40%;' ><input type='text' placeholder="Phone Number" style='width:200%; 
height:50''box-sizing:border-box;'  maxlength='40' name='Phone' /></td>
<td style='width:350px; style='height="50px"></td></tr><tr style='display:none;' ><td 
style='word-break: break-word;text-align:left;font-size:16px;font- 
family:Avenir;font:Avenir;width:30%'>Lead Source</td><td style='width:40%;'>
    <select style='width:100%;box-sizing:border-box;' name='Lead Source'>
    </select></td><td style='width:30%;' ></td></tr><tr style='display:none;' ><td 
 style='word-break: break-word;text-align:left;font-size:16px;font-family:Arial;width:30%'> Introducer </td>
<td style='width:40%;' ><input type='text' style='width:100%;box-sizing:border-box;'  maxlength='255' name='LEADCF1' value='ContractorPeople'></input></td>
    <td style='width:30%;'></td></tr><tr><td  style='word-break: break-word;text-align:left;font-size:16px;font-family:Arial;width:30%;' ></td><td  style='width:40%;'> <textarea name='Description' maxlength='32000' style='width:200%;height:100' >&nbsp;</textarea></td>
<td style='width:30%;'></td></tr>

    <tr><td colspan='2' style='text-align:69%; padding-top:15px;font-size:16px;'>
  <button id="formssubmit">SUBMIT QUERY</button><style type="text/css" type="submit">

#formssubmit { 
 background-color: #ffffff;
 padding: .5em;
 -moz-border-radius: 5px;
 -webkit-border-radius: 5px;
 border-radius: 6px;
 color: #ddddd;
 font-family: 'Avenir';
 font-size: 20px;
 text-decoration: none;
 border:color:#ffffff;
}

#formssubmit:hover {
 border: none;
 background: #9799A4;
 box-shadow: 0px 0px 1px #ffffff;
}

I had a look and there is a lot going on.我看了看,发生了很多事情。 I don't see why in each row you have 3 columns.我不明白为什么每行都有 3 列。 I would remove the first and last as you use your input in the 2nd td but the first and last seem empty:当您在第二个 td 中使用您的输入时,我会删除第一个和最后一个,但第一个和最后一个似乎是空的:

I would move these table divisions and work with what is left: <td style="word-break: break- word;text-align:left;font-size:16px;font-family:Avenir;font:Avenir;width:30%;"><span style="color:red;"></span></td>我会移动这些表格分区并使用剩下的部分: <td style="word-break: break- word;text-align:left;font-size:16px;font-family:Avenir;font:Avenir;width:30%;"><span style="color:red;"></span></td>

<td style="width:350px; style=" height="50px"></td>

then you can style the td with your input, you can for example use padding: 0 20px or style different width so you can position all your inputs the way you want to.然后您可以使用输入设置 td 样式,例如,您可以使用padding: 0 20px或设置不同width的样式,这样您就可以按照您想要的方式 position 所有输入。

regarding background colors of the input boxes and since you are using inline style you can simply do:关于输入框的背景 colors 并且由于您使用的是内联样式,因此您可以简单地执行以下操作:

<input style="width:200%;height:50; background:#3A3B3F;">

regarding the button positioning: now that you have less table divisions it's also easier to position your button on the right.关于按钮定位:现在您的表格划分较少,position 您的按钮在右侧也更容易。 You can for example add the following css to your formssubmit button:例如,您可以将以下 css 添加到您的表单提交按钮:

#formssubmit {
  float: right;
  margin-right: 10px;
  margin-bottom: 10px;
}

and it will position on the right with a bit of margin.它会在右边有一点余量的 position。

Does that already help reshape your form a bit closer to what you want it to be?这是否已经有助于重塑您的表单,使其更接近您想要的样子?

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

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