开发者

HTML table column on my web page is not displaying within set parameter. How do I fix this?

开发者 https://www.devze.com 2023-03-13 07:45 出处:网络
How do get my columns to behave in html?(Unfortunately, I am not well versed in CSS.)Currently, my table has six columns. The first and sixth columns are set for width=\"10%\", and they are behaving w

How do get my columns to behave in html? (Unfortunately, I am not well versed in CSS.) Currently, my table has six columns. The first and sixth columns are set for width="10%", and they are behaving well as space holders (transparent-to-background borders). The third and fourth columns are controlled by "colspan" code, which isn't fixed and yet seems to be working well enough. However, the second and fifth columns are set for width="24%", which isn't working. The second column displays wider than the fifth column on all browsers. How do I make the second and fifth columns' width fixed?

A portion of the code governing the page background, header, subheader, left and right border columns, and the first two of several rows is provided below (WARNING - I am a rank amateur so my coding will likely offend the sophisticate). I hope this is sufficient for a diagnosis. (Note: I have replaced identifying content info with "*".)

<html>
<head>
<title>***</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css"> 
body
{background-("***");
background-repeat:repeat;
background-attachment:fixed}
</style>
</head>

<body bgcolor="#1c1f00" background="***" text="#000000" link="#0066开发者_StackOverflow中文版00" vlink="#003333" alink="#FF0033">
<table width="100%" height="2000" align="center" cellspacing="0" cellpadding="3">
  <tr>
    <td rowspan="12" width="10%">&nbsp;</td>
    <td colspan="4" bgcolor="#000000" height="20"></td>
    <td rowspan="12" width="10%">&nbsp;</td>
  </tr>
  <tr> 
    <th bgcolor="#CCCC99" background="***" height="200" colspan="4">
      <"***" align="center" valign="top" width="1000" height="200" vspace="0" hspace="0" border="0">
    </th>
  </tr>
  <tr>
    <td bgcolor="#1c1f00" height="110" colspan="3">
      <font face="Papyrus" size="4" color="#CCCC66" align="left" valign="bottom" hspace="10"><b>***</b></font>
    </td>
    <td bgcolor="#1c1f00" height="110" colspan="1">
      <a href="***"><"***" align="right" width="64" height="64" vspace="0" hspace="20" border="0"></a>
    </td>
  </tr>
  <tr>
    <td width="24%" bgcolor="#FFFFFF" valign="top" height="130">
      <div align="center"><p style="border: solid 10px #252b00; background: #CCCC99; padding: 15px; -moz-border-radius: 15px; -khtml-border-radius: 15px; -webkit-border-radius: 15px; border-radius: 15px; margin: 0; text-align: center; line-height: 23px; color: #252b00; font-size: 40px">***</p>
        <p><font face="Georgia, Times New Roman, Times, serif" size="3"><b><u>***</u></b><br>
     ***<br>
          ***<br>
          ***<br>
          ***</font></p>
      </div>
      <div align="center"> 
        <hr>
      </div>
    </td>
    <td colspan="2" rowspan="7" bgcolor="#CCCC99" valign="top"><p>&nbsp;</p>
      <blockquote>
        <p align="center"><font face="Georgia, Times New Roman, Times, serif" size="4"><b>***</b></p>
        <p><font face="Georgia, Times New Roman, Times, serif" size="3">*** 3 paragraphs of content followed by space for more content ***</font></p>        
      </blockquote>
    </td>
    <td width="24%" bgcolor="#FFFFFF" valign="top" height="130">
      <div align="center"><p style="border: solid 10px #252b00; background: #CCCC99; padding: 15px; -moz-border-radius: 15px; -khtml-border-radius: 15px; -webkit-border-radius: 15px; border-radius: 15px; margin: 0; text-align: center; line-height: 23px; color: #252b00; font-size: 40px">***</p> 
        <p><font face="Georgia, Times New Roman, Times, serif" size="3"><b><u>***</u></b><br> 
     ***<br>
          ***<br>
          ***<br>
          ***</font></p>
      </div>
      <div align="center"> 
        <hr>
      </div>
    </td>
  </tr>
  <tr> 
    <td width="24%" bgcolor="#FFFFFF" valign="top" height="130"> 
      <div align="center"> <font face="Georgia, Times New Roman, Times, serif" size="3"><b><u>SERVICES</u></b><br>
     ***<br>
          ***<br>
          ***<br>
          ***</font></p>
      </div>
      <div align="center"> 
        <hr>
      </div>
    </td>
    <td width="24%" bgcolor="#FFFFFF" valign="top" height="130"> 
      <div align="center"> <font face="Georgia, Times New Roman, Times, serif" size="3"><b><u>***</u></b><br>
     ***<br>
          ***<br>
          ***<BR>
     ***</font></p>
      </div>
      <div align="center"> 
        <hr>
      </div>
    </td>
  </tr>

...


If you use actual sizes instead of %'s it should work. If you are making everything in a div, try making the div a set size, and then the table a set size with margins if you want to center it, and then size each row. w3schools has really good tutorials for css and for in-line styling with html, which basically is css.

Percents are always touchy too, because if you change the size of the window, the size of the rows will change too. If that's the effect you want, play around with it.

0

精彩评论

暂无评论...
验证码 换一张
取 消