Solved

Table Problem-Urgent

Posted on 2003-11-14
11
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
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 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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

622 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