-1

我遇到了一个需要编写 HTML 或 CSS 代码的任务。如何制作空间或设置定位?我的任务是使页面看起来像这样:

report1                                               report2
report3                                               report4
report5                                               report6

在阅读并环顾四周后,我尝试了这段代码

<font size=3>
 <a  href="http://obi-dev.jr.local:9704/analytics/saw.dll?bipublisherEntry&Action=open&itemType=.xdo&bipPath=%2FPrototype%2Fprice%20testing%20report.xdo&path=%2Fshared%2FPrototype%2Fprice%20testing%20report.xdo">
Price Testing Report </a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a  href="http://obi-dev.jr.local:9704/analytics/saw.dll?bipublisherEntry&Action=open&itemType=.xdo&bipPath=%2FPrototype%2Fprice%20testing%20report.xdo&path=%2Fshared%2FPrototype%2Fprice%20testing%20report.xdo">Price Testing Report 
     </a> 
</font>

所以我的问题是,是否可以用   代替 tabs ?有没有办法让它自动定位?

请尽可能详细,因为我对 HTML 一无所知。提前谢谢大家

4

2 回答 2

1

我个人更喜欢使用没有表格的更简单的方法,所以这是非表格解决方案,对于任何想要非表格方法的人来说更简单:

CSS:

//adjust the numbers how you see fit

.box{
    display:inline-block;
    vertical-align:top;
    width:50px;
    height:50px;
}
.push{
    margin-left:150px;
}

HTML:

<div class="box"> Hello </div><div class="box push"> Hello </div> <br/>
<div class="box"> Hello </div><div class="box push"> Hello </div> <br/>
<div class="box"> Hello </div><div class="box push"> Hello </div> <br/>

工作示例:

http://jsfiddle.net/y62zp/2/

于 2013-08-29T18:02:06.570 回答
0

<pre>标签将保留您想要的空间。它还将包括任何断线

<pre> 
Look      at     all    the spaces
and
the
break
lines
</pre>

正如 Oberon 在对此答案的评论中指出的那样。另一种方法(不那么不赞成)是使用表格。

<html>
<body> 
<table border=1" > 
<tr><th>Col 1</th><th>Col 2</th></tr>
<tr>
<tr>
<td>Value 1a</td>
<td>Value 1b<td>
</tr>
<tr>
<td>Value 2a</td>
<td>Value 2b<td>
</tr>
</body>
</html>

这会给你这个。 表格样本

编辑基于 OPs 评论
使用以下内容将帮助您对齐某些内容或将属性分配给您的表格或每个“单元格”

桌子

 <table border=5" height="80" width="75%" bgcolor=#FAF93C style="table-layout: fixed; width: 75%"> 

细胞

<td align="left">This Text is aligned to the left</td>
于 2013-08-29T17:41:25.880 回答