Solved

Table Problem-Urgent

Posted on 2003-11-14
11
296 Views
Last Modified: 2010-04-09
hi,
  I have a table such as this :

<table border="4"BGColor="#FFF8DC" width="60%" CELLPADDING="4" style="margin-left:190px;" >
   <tr>
     <td align=center>
       Organation Name
     </td>
     <td align=center>
       Project Name
     </td>

   <td align=center>
     Description
   </td>
   <td align=center>
     Start Date
    </td>
   <td align=center>
     End Date
    </td>
    <td align=center>
     Required Skills
     </td>

   </tr>
 </table>


<table border="1"BGColor="#FFFFF0" width="60%" CELLPADDING="4" style="margin-left:190px;" >

<tr>

<td align=center><%= rs.getString( "organname") %></td>
     <td align=center> <%= rs.getString("projectid" ) %></td>
     <td align=center><%= rs.getString( "description") %></td>
     <td align=center> <%= rs.getString("start" ) %></td>
     <td align=center><%= rs.getString( "end") %></td>
     <td align=center> <%= rs.getString("skillid" ) %></td>

   </tr>
</table>


My problem is when this two tables came out, the first table (headings) do not fit the second table width.If the second table has a lot rows , the length of each column is not same with each other as well as the headings.

How d o i modify this.
Thanks
0
Comment
Question by:Jasbir21
11 Comments
 
LVL 19

Expert Comment

by:Dexstar
ID: 9751962
Jasbir21:

> My problem is when this two tables came out, the first table (headings) do
> not fit the second table width.If the second table has a lot rows , the length
> of each column is not same with each other as well as the headings.

DO NOT use 2 tables.  Use one.  Basically, just take out the first </table> and the second <table...> tags, and see how it looks.

Hope That Helps,
Dex*
0
 

Author Comment

by:Jasbir21
ID: 9752099
hi,

  When i try to use one table, the border and color for the headings becames similar for the data in the rows.

Actually, i need to have the headings in a different border and the data(rows ) in a different border.

I mean the color for the headings table in a bit dark with the style a bit lifted up but the color for the data in table row is a bit light with not lifted up.


thanks
0
 

Assisted Solution

by:slatif
slatif earned 40 total points
ID: 9752176
Try this:

<table border="4" BGColor="#FFF8DC" width="60%" CELLPADDING="4" style="margin-left:190px;" >
   <tr>
     <td align=center width="10%">
       Organation Name
     </td>
     <td align=center width="10%">
       Project Name
     </td>

   <td align=center width="10%">
     Description
   </td>
   <td align=center width="10%">
     Start Date
    </td>
   <td align=center width="10%">
     End Date
    </td>
    <td align=center width="10%">
     Required Skills
     </td>

   </tr>
 </table>


<table border="1" BGColor="#FFFFF0" width="60%" CELLPADDING="4" style="margin-left:190px;" >

<tr>


       <td align=center width="10%"><%= rs.getString( "organname") %></td>
     <td align=center width="10%"> <%= rs.getString("projectid" ) %></td>
     <td align=center width="10%"><%= rs.getString( "description") %></td>
     <td align=center width="10%"> <%= rs.getString("start" ) %></td>
     <td align=center width="10%"><%= rs.getString( "end") %></td>
     <td align=center width="10%"> <%= rs.getString("skillid" ) %></td>

</tr>
</table>

Hope this will work.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 31

Accepted Solution

by:
seanpowell earned 60 total points
ID: 9752217
You can play around with the colors and sizes, but CSS is the best way to deal with this, all in one table:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title></title>
<style type="text/css">
<!--
table.header { margin-left:190px; width:60%; }
td.heading    { border: medium ridge #cccccc; background-color:#FFF8DC; padding:2px; }
td.data         { border:thin solid #cccccc; background-color:#FFFFF0; padding:2px; }
//-->
</style>
</head>
<body>
<table class="header" border="1">
  <tr>
    <td align=center class="heading">Organation Name</td>
    <td align=center class="heading">Project Name</td>
    <td align=center class="heading">Description</td>
    <td align=center class="heading">Start Date</td>
    <td align=center class="heading">End Date</td>
    <td align=center class="heading">Required Skills</td>
  </tr>
  <tr class="data">
    <td align=center class="data">%= rs.getString( "organname") %></td>
    <td align=center class="data"><%= rs.getString("projectid" ) %></td>
    <td align=center class="data"><%= rs.getString( "description") %></td>
    <td align=center class="data"><%= rs.getString("start" ) %></td>
    <td align=center class="data"><%= rs.getString( "end") %></td>
    <td align=center class="data"><%= rs.getString("skillid" ) %></td>
   </tr>
</table>
</body>
</html>
0
 

Author Comment

by:Jasbir21
ID: 9752219
thank you,it works fine

God bless
0
 
LVL 19

Expert Comment

by:Dexstar
ID: 9752226
slatif:  That still won't work if any of the fields exceed 10%

jasbir:  Use style tags to control the border on the header row.  That will be 10x easier than trying to get 2 tables to line correctly 100% of the time with variable data.

Enjoy,
Dex*
0
 

Author Comment

by:Jasbir21
ID: 9752233
thank you all for the input, i splitted the points because both of your answers help me.

Thanks again
0
 
LVL 19

Expert Comment

by:Dexstar
ID: 9752243
What's up with that?  You used my idea of 1 table, but I didn't get any points?  How did slatif's suggestion help you?  It doesn't even work...

D*
0
 

Author Comment

by:Jasbir21
ID: 9752261
hi,
   georgemarin,
 
when i tried  the headings column size does not match the data column

do, i need to add something

Thanks
0
 

Author Comment

by:Jasbir21
ID: 9752296
..hi,
  i get it you use one table, and i combined it with 2 table, that's why the column doesn't match.


Sorry,

Dexstar,
  I am very sorry, i spliteed points into three but i guess i did an error something.

I am posting for the points at a new link ,pls accept it with humble appologies.
Thanks
0
 

Author Comment

by:Jasbir21
ID: 9752307
Dexstar,
  pls go to this link:

http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20798719.html

Pls accept it
Thank you
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Changing Two Areas of a Page 5 27
multiple selects 23 49
HowTo set a global variable in javascript or jQuery 4 22
Search Item in Table 2 22
Find out what you should include to make the best professional email signature for your organization.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question