471,881 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,881 software developers and data experts.

problem with div tag

46
Hi!

I have a problem with div tag i want to increase the width of my div tag...i have two tables, one tablewhich consists of two rows and one table(using div tag) consists of many rows.Here the two tables should be displayed one under the other...it should look like same table as if there are two...check my code n tell me a solution...

Expand|Select|Wrap|Line Numbers
  1. <div id='div1' style='height:0px;position:relative'><table class='mytable' cellspacing=1 cellpadding=2 border=0 width=100px><tr bgcolor=#D4E5F7><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th><th>F</th><th>g</th> </tr><tr>
how to increase width of table in div tag???????????
Aug 9 '07 #1
2 1603
Hi!

I have a problem with div tag i want to increase the width of my div tag...i have two tables, one tablewhich consists of two rows and one table(using div tag) consists of many rows.Here the two tables should be displayed one under the other...it should look like same table as if there are two...check my code n tell me a solution...

Expand|Select|Wrap|Line Numbers
  1. <div id='div1' style='height:0px;position:relative'><table class='mytable' cellspacing=1 cellpadding=2 border=0 width=100px><tr bgcolor=#D4E5F7><th>a</th><th>b</th><th>c</th><th>d</th><th>e</th><th>F</th><th>g</th> </tr><tr>
how to increase width of table in div tag???????????

first of all
in div id='div1' in that what u write i don't no.

second:::
once you mentioned the width of div tag it should be fixed.

example:
Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2. div.setwidth { 
  3. width: 860px; 
  4. background-color:red;
  5. </style>
in that table width you can give 100% or exact 860px.
other wise div width will be increase along with the table width. ( if table width>860px )

i pasted here some code just you check it.

[HTML]
<html>
<head>
<style type="text/css">

div.setwidth {
width: 860px;
background-color:red;
}
</style>
</head>

<body>
<div class="setwidth">
<table width="600" cellspacing="0" cellpadding="0" bgcolor="#CCCCCC">
<tr>
<td>abcd</td>
</tr>
<tr>
<td><div>this</div></td>
</tr>
<tr>
<td>ijkl</td>
</tr>
</table>
<table width="600" cellspacing="0" cellpadding="0" bgcolor="#000" style="color:#ffffff; ">
<tr>
<td>123</td>
</tr>
<tr>
<td>456</td>
</tr>
<tr>
<td>789</td>
</tr><tr>
<td>012</td>
</tr>
</table>
</div>

</body>
</html>
[/HTML]
please paste here exact code then i will give you clear information.

thank you,
chandu.majeti
web developer.
Aug 9 '07 #2
honey99
46
plz check this code once

[HTML]<div id='div1' style='height:0px;position:relative;'>
<table class='mytable'cellspacing=1 cellpadding=2 border=0 width=100px><tr bgcolor=#D4E5F7>
<th>S</th><th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th> </tr>;
[/HTML]

document.getElementById("div1").innerHTML=render;
Aug 9 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

117 posts views Thread by Peter Olcott | last post: by
28 posts views Thread by Jon Davis | last post: by
6 posts views Thread by Ammar | last post: by
2 posts views Thread by Mike Collins | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.