为什么在HTML中添加新行?

时间:2018-11-04 05:32:37

标签: html css

当我这样编码时:

[HttpGet]
[Authorize]
[Route("api/getproperties")]
public async Task<List<Property>> GetProperties()
{
    using(var db = new ApplicationDbContext())
    {
        var properties = await (from p in db.Properties
                        join pt in db.PropertyTypes
                        on p.PropertyTypeId equals pt.PropertyTypeId
                        select new
                        {
                            PropertyId = p.PropertyId,
                            PropertyName = p.PropertyName,
                            Owner = p.Owner,
                            Cluster = p.Cluster,
                            PropertyNumber = p.PropertyNumber,
                            RegionCode = p.RegionCode,
                            ProvinceCode = p.ProvinceCode,
                            MunicipalCode = p.MunicipalCode,
                            BarangayCode = p.BarangayCode,
                            DateAdded = p.DateAdded,
                            DateModified = p.DateModified,
                            PropertyTypeId = p.PropertyTypeId,
                            PropertyType = p.PropertyType,
                            Type = pt.Type
                        }
                                ).ToList()
                                .Select(x => new Property
                                {
                                    PropertyId = x.PropertyId,
                                    PropertyName = x.PropertyName,
                                    Owner = x.Owner,
                                    Cluster = x.Cluster,
                                    PropertyNumber = x.PropertyNumber,
                                    RegionCode = x.RegionCode,
                                    ProvinceCode = x.ProvinceCode,
                                    MunicipalCode = x.MunicipalCode,
                                    BarangayCode = x.BarangayCode,
                                    DateAdded = x.DateAdded,
                                    DateModified = x.DateModified,
                                    PropertyTypeId = x.PropertyTypeId,
                                    PropertyType = x.PropertyType,
                                    Type = x.Type
                                }).ToListAsync();

        return properties;
    }
}

“ a”和文本框之间没有换行符。

但是,当我这样编码时:

<html>

<body>
  <table width="250">
    <tr>
      <td>
        <select>
          <option>AAA</option>
        </select>
      </td>
      <td>
        a <input type="text">
      </td>
    </tr>
  </table>
</body>

</html>

“ a”和文本框之间有一条新线。

我刚刚添加了5行。

如何在没有新行的情况下制作它?

2 个答案:

答案 0 :(得分:2)

这是因为您选择的宽度与整个表格的宽度相同。您应该使表格更宽或更窄。

public func solution(_ N : Int, _ A : inout [Int]) -> [Int] {
  var counters = Array(repeating: 0, count: N)
  var _max = 0
  var _min = 0
  for i in A {
    if counters.count >= i {
      let temp = max(counters[i-1] + 1, _min + 1)
      _max = max(temp, _max)
      counters[i-1] = temp
    } else {
      _min = _max
    }
  }
  return counters.map { max($0, _min) }
}

答案 1 :(得分:0)

首先删除两个结束标记.. 我不知道为什么您的代码无法正常工作... 但是如果您不希望在a和输入之间添加任何新行,请将其包装在里面

@Override
public View getView(int position, View convertView, ViewGroup parent) 
{
    // ...
    likeButton = (Button) v.findViewById(R.id.like_button);
    likeButton.setBackgroundResource(currentProduct.isLiked() ? R.drawable.liked : R.drawable.something);
    // continue...