Ir ao conteúdo
  • Cadastre-se

Ajuda tabela ASP


Posts recomendados

Olá Pessoal,

 

Eu estou montando um site e sou relativamente novo em programação e estou tendo algumas dificuldades com tabelas dentro desse site.

 

Anexei uma foto do problema que eu estou tendo:

 

post-728976-0-85817000-1404418615_thumb.

 

Como vocês podem ver a coluna "fundo" , "indicadores" e "data" estão bem maiores do que o resto.

 

Essa tabela esta feita no excel e no código esta puxando do excel, essa tabela não esta feita direto no código.

 

Segue o CSS:

 

/* Tables ---------------------- */table { width: 100%; background: #fff; -webkit-border-radius: 1px; -moz-border-radius: 1px; -ms-border-radius: 1px; -o-border-radius: 1px; border-radius: 1px; margin: 0 0 18px; border: 1px solid #dddddd; }table thead, table tfoot { background: #f5f5f5; }table thead tr th, table tfoot tr th, table tbody tr td, table tr td, table tfoot tr td { display: table-cell; font-size: 11px; line-height: 13px; /*text-align: center;*/ }table thead tr th, table tfoot tr td { padding: 6px 8px 7px; font-size: 09px; font-weight: bold; /*color: #000;*/ text-align:center }table thead tr th:first-child, table tfoot tr td:first-child { border-left: none; }table thead tr th:last-child, table tfoot tr td:last-child { border-right: none; }table tbody tr.even, table tbody tr.alt { background: #e1e1e1; }table tbody tr:nth-child(even) { background: #e1e1e1; }table tbody tr td { color: #989898; padding: 5px 6px; vertical-align: middle; border: none; font-size:11px; width:50%; height:50%; }
E Segue o código da página:
 
<%Dim objConn, objRS, strSQLDim x, curValue, LINHASet objConn = Server.CreateObject("ADODB.Connection")objConn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Server.MapPath("cotas-fundo.xls") & ";Extended Properties=Excel 12.0;"""strSQL = "SELECT * FROM A1:Q10000"Set objRS=objConn.Execute(strSQL)Response.Write("<table width='100%'><tbody><tr><td><h4>FUNDO</h4></td><td><h4>Data</h4></td><td><h4>Cota</h4></td><td><h4>Dia</h4></td><td><h4>Mês</h4></td><td><h4>Ano</h4></td><td><h4>12m</h4></td><td><h4>24m</h4></td><td><h4>Status</h4></td>")Response.Write("<tr>")For x=0 To objRS.Fields.Count-1NextResponse.Write("</tr>")linha=0Do Until objRS.EOF    Response.Write("<tr>")    For x=0 To objRS.Fields.Count-1        curValue = objRS.Fields(x).Value        If IsNull(curValue) Then            curValue="N/A"        End If        curValue = CStr(curValue)                If Linha=1 Then              link = "fundos-estruturados-Jive-TOP.asp#simple1"        End If        If Linha=2 Then              link = "fundos-estruturados-Jive-ETR.asp#simple1"        End If        If Linha=0 Then              link = "fundos-estruturados-Jive-CASH.asp#simple1"        End If        If x=0 Then           Response.Write("<td><a href=" & link & ">" & curValue & "</a></td>")        Else           Response.Write("<td>" & curValue & "</td>")        End If            Next    Response.Write("</tr>")    linha=linha+1    objRS.MoveNextLoopobjRS.CloseResponse.Write("</table>")objConn.CloseSet objRS=NothingSet objConn=NothingSet objConn = Server.CreateObject("ADODB.Connection")objConn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Server.MapPath("cotas-indicadores.xls") & ";Extended Properties=Excel 12.0;"""strSQL = "SELECT * FROM A1:Q10000"Set objRS=objConn.Execute(strSQL)Response.Write("<table><tbody width='100%'><tr><td><h4>Indicadores</h4></td><td><h4>Data</h4></td><td><h4>Cota</h4></td><td><h4>Dia</h4></td><td><h4>Mês</h4></td><td><h4>Ano</h4></td><td><h4>12m</h4></td><td><h4>24m</h4></td><td><h4>Status</h4></td>")Response.Write("<tr>")For x=0 To objRS.Fields.Count-1NextResponse.Write("</tr>")Do Until objRS.EOF    Response.Write("<tr>")    For x=0 To objRS.Fields.Count-1        curValue = objRS.Fields(x).Value        If IsNull(curValue) Then            curValue="N/A"        End If        curValue = CStr(curValue)        Response.Write("<td>" & curValue & "</td>")    Next    Response.Write("</tr>")    objRS.MoveNextLoopobjRS.CloseResponse.Write("</table>")objConn.CloseSet objRS=NothingSet objConn=Nothing%>
 
 
Espero que me ajudem.
 
Obrigado.
Link para o comentário
Compartilhar em outros sites

Olá

Isso acontece Porque você esta definindo que todas as células tenham 50% de largura, como existe mais de 2 colunas logo não fica certo.

 

seu css:

table tbody tr td { color: #989898; padding: 5px 6px; vertical-align: middle; border: none; font-size:11px; width:50%; height:50%; }

Podem existir várias formas de corrigir, uma delas é definir a regra na propria celula.

<td style="width:20%">[conteudo da celula]</td> 

OU

 

crie uma classe CSS para as celuas especificas e defina sua regras:

<td class='fundo'>[conteudo da celula]</td> 
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...