HTML - impresion de variables incorrecta

 
Vista:
sin imagen de perfil
Val: 51
Ha disminuido su posición en 8 puestos en HTML (en relación al último mes)
Gráfica de HTML

impresion de variables incorrecta

Publicado por zendi (79 intervenciones) el 02/06/2014 17:52:21
Que tal a todos, heme por aqui otra vez.
Estoy desarrollando una pagina con un motor de busqueda, pero tengo un problemilla cuando se imprime, coloca la impresion de forma inadecuada, sino que se imprimen de forma vertical las variables, es decir que aparece estirada, cuando debiera hacerlo de forma horizontal. He revisado el estilo, los <table>, <tr> y los <td> pero no hallo el error, a ver si alguien puede verlo por favor.
He aqui el codigo:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
require_once("classblog.php");
$tra=new Trabajo();
 
$sql = "SELECT COUNT(*) AS total FROM noticias WHERE
titulo LIKE '%".$_GET['s']."%' or
detalle LIKE '%".$_GET['s']."%'";
$res = @pg_query(Conectar::con(),$sql);
if ($req = @pg_fetch_array($res))
{
	$total=$req["total"];
}
$resto = $total % 11;
$ultimo = $total-$resto;
//************************
if (isset($_GET["pos"]))
{
	$inicio=$_GET["pos"];
}
else
{
	$inicio=0;
}
$sql = "SELECT * 
          FROM noticias 
		 WHERE titulo 
		 LIKE '%".$_GET['s']."%'  or detalle 
		 LIKE '%".$_GET['s']."%' 
		limit 10 offset $inicio";
$res = @pg_query(Conectar::con(),$sql);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Buscador</title>
<link href="css/estilos.css" type="text/css" rel="stylesheet"/>
<style type="text/css">

	#main{ width:800px; height:%100; float:left}

</style>

</head>

<body>
  <div id="header" align="center">Seguridad Industrial</div>
	<div id="main">
		<div id="menu">
			<?php include("menublog.php");?>
			<div id="buscador">
				<form name="buscador" method="get" action="resultados.php">
				<div id="buscador">
				  <input type="text" name="s" title="Buscar">
                  <a href="javascript:void(0)" title="Buscar"  onClick="document.buscador.submit();">
                  <img src="img/buscador.GIF" width="24" height="24" border="0">
			      </a>
				</div>
				</form>
			</div>
		</div>
	</div>
  </div>



<div id="main">

<table colspan="2" align="center" width="100" valign="top" height="25">
<tr>
<td>
<h3>Resultados de la Busqueda</h3></td></tr>
   <tr>
    <td align="center">Titulo</td> 
    <td align="center">Detalle</td> 
   </tr>
<?php 

if (@pg_num_rows($res)==0)

{
  ?>
  <tr>
      <td>
  No hay Registros para ese criterio de busqueda
      </td>
   </tr>
   <?php
}else

{


$impresos = 0;
while($req = pg_fetch_array($res))
{
$impresos ++;
?>
<tr align="center" width="100" valign="top" height="25">
   <td>
    <?php echo strtoupper(str_replace("".$_GET["s"]."","<b>".$_GET["s"]."</b>",$req['titulo'])); ?>
   </td>
   <td align="center" width="100" valign="top" height="25">
    <?php echo Conectar::corta_palabra($req["detalle"],150);?>...
<hr>
    <?php echo str_replace("".$_GET["s"]."","<b>".$_GET["s"]."</b>",$req['detalle']);?></td>
</tr>
<?php
}
}
?>
<tr>
<td colspan="2">
<hr>
<?php
if (!$inicio == 0)
{
	?>
	<a href="resultados.php?s=<?php echo $_GET["s"]?>&pos=0" title="Primero">Primero</a>
	<?php
}
else
{
  ?>
	Primero
  <?php	
}
?>
<?php 
if ($inicio == 0)
{
  ?>
  Anterior
  <?php
}
else
{
 ?>
  <a href="resultados.php?s=<?php echo $_GET["s"]?>&pos=<?php echo $inicio-10;?>" title="Anterior">Anterior</a>
<?php
}
?>
<?php 
    if($impresos==10)
     {
?>
	<a href="resultados.php?s=<?php echo $_GET["s"]?>&pos=<?php echo $inicio+10;?>" title="Siguiente">Siguiente</a>
 <?php
    }
    else 
    {
?>
 Siguientes
<?php
}
?>
<!---->
<?php 
   if ($inicio==$ultimo)
     {
?>
    Ultimo
<?php
}
else
{
?>
 <a href="resultados.php?s=<?php echo $_GET["s"]?>&pos=<?php echo $ultimo;?>" title="Ultimo">Ultimo</a>
<?php
}
?>
</td>
</tr>
</table>
</div>
</body>
</html>

envio tambien la impresion:

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder