Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Table Problem-Urgent

Posted on 2003-11-14
11
Medium Priority
?
302 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 160 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 31

Accepted Solution

by:
seanpowell earned 240 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
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)

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