Solved

Table Problem-Urgent

Posted on 2003-11-14
11
293 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 31

Accepted Solution

by:
seanpowell earned 60 total points
Comment Utility
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
Comment Utility
thank you,it works fine

God bless
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 19

Expert Comment

by:Dexstar
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
..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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now