Retroceder   Foros del Web > Diseño de Sitios web > CSS

Respuesta
 
Herramientas Desplegado
Antiguo 12-sep-2007, 09:50   #1 (permalink)
DragonX llegará a ser famoso muy prontoDragonX llegará a ser famoso muy prontoDragonX llegará a ser famoso muy prontoDragonX llegará a ser famoso muy pronto
 
Avatar de DragonX
 
Fecha de Ingreso: noviembre-2002
Ubicación: Funkyland
Mensajes: 6.945
Tablas + CSS

hola gente, como les va?

Estoy haciendo pruebas con tablas y CSS y he quedado asombrado de lo que se puede hacer.

Estoy teniendo problemas con el ancho fijo de las columnas, en FF anda perfecto, en IEx no me toma los anchos. les dejo el código:

Código HTML:
table{
  width: 80%;
}
table, th, td {
	border: 1px solid #D4E0EE;
	border-collapse: collapse;
	font-family: "Trebuchet MS", Arial, sans-serif;
	color: #555;
}

caption {
	font-size: 150%;
	font-weight: bold;
	margin: 5px;
}

td, th {
	padding: 4px;
}
th.fecha{
   width: 60px;
}
th.dni{
  width: 50px;
}
thead th {
	text-align: center;
	background: #E6EDF5;
	color: #4F76A3;
	font-size: 100% !important;
}
tbody th {
	font-weight: bold;
}

tbody tr { background: #FCFDFE; }

tbody tr.odd { background: #F7F9FC; }

table a:link {
	color: #718ABE;
	text-decoration: none;
}

table a:visited {
	color: #718ABE;
	text-decoration: none;
}

table a:hover {
	color: #ff5900;
	text-decoration: underline !important;
}

tfoot th, tfoot td {
	font-size: 85%;
}
y el HTML:

Código HTML:
<table summary="Tabla de ejemplo">
	<caption>Tablas con CSS</caption>
	<thead>
		<tr>
			<th>Datos %</th>
			<th class="fecha">Fecha</th>
			<th class="dni">D.N.I.</th>
			<th>Datos %</th>
			<th>Datos %</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<th>Dato 11</th>
			<td>05/06/07</td>
			<td>24.353.185</td>
			<td>Dato 14</td>
			<td><a href="#">Dato 15</a></td>
		</tr>
		<tr class="odd">
			<th>Dato 21</th>
			<td>05/06/06</td>
			<td>24.353.185</td>
			<td>Dato 24</td>
			<td><a href="#">Dato 25</a></td>
		</tr>
		<tr>
			<th>Dato 31</th>
			<td>05/06/05</td>
			<td>24.353.185</td>
			<td>Dato 34</td>
			<td><a href="#">Dato 35</a></td>
		</tr>
		<tr class="odd">
			<th>Dato 41</th>
			<td>05/06/04</td>
			<td>24.353.185</td>
			<td>Dato 44</td>
			<td><a href="#">Dato 45</a></td>			
		</tr>
	</tbody>
</table>
Gracias de antemano!
__________________
Diseño web y maquetación

ya no tengo más blog...pero tengo muestrario
DragonX está desconectado   Responder Citando
Antiguo 13-sep-2007, 14:10   #2 (permalink)
Colaborador
Daniel Ulczyk llegará a ser famoso muy prontoDaniel Ulczyk llegará a ser famoso muy pronto
 
Avatar de Daniel Ulczyk
 
Fecha de Ingreso: febrero-2005
Ubicación: Buenos Aires
Mensajes: 1.146
Enviar un mensaje por Skype™ a Daniel Ulczyk
Re: Tablas + CSS

Hola DragonX
Antes que nada, convengamos y pongámonos de acuerdo sobre el Doctype del documento.
Para mis pruebas he utilizado:
Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Ahora bien, en mis prácticas no suelo utilizar la declaración del width sobre una class en el th, sino en el primer td.
Por lo que el CSS sería:
Código HTML:
td.fecha{
   width: 60px;
}
td.dni{
  width: 50px;
}
en lugar de:
Código HTML:
th.fecha{
   width: 60px;
}
th.dni{
  width: 50px;
}
y EL html sería:
Código HTML:
            <td class="fecha">05/06/07</td>
            <td class="dni">24.353.185</td>
en lugar de:
Código HTML:
             <th class="fecha">Fecha</th>
            <th class="dni">D.N.I.</th>
Finalmente, la medida real es padding+width+padding=68px
Siempre y cuando declare el tamaño de la fuente en px, porque sin declararlo toma el browser default.
Para mi ejemplo agregué:
Código HTML:
table, th, td {
    font-size: 14px;
}
Sirve esto?
Daniel Ulczyk está desconectado   Responder Citando
Respuesta

No hay votos aún.


Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes

BB code is Activado
Caritas están Activado
[IMG] está Activado
Código HTML está Desactivado


La Zona horaria es GMT -6. Ahora son las 02:19.


Message Board Statistics

LinkBacks Enabled by vBSEO 3.1.0

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