|
-
Jul 24th, 2012, 06:21 PM
#1
Thread Starter
Hyperactive Member
-
Jul 24th, 2012, 10:31 PM
#2
Thread Starter
Hyperactive Member
Re: <div> in <td> element
ok here is what i found, TD position should not be set to absolute. a work around for me was to wrapp the 2 div in another div container
Code:
<td style="position:relative;text-align:center;">
<div style="position:absolute;text-align:center;border:1px solid grey;width:100%;height:100%;top:0px;left:0px;">
<div class="databar" style="position: absolute; height: 90%; width: 60%; border: thin solid aqua;background:yellow; left: 2px;top:0px;"></div>
<div style="position:absolute;left:30%;width:40%;border:1px solid green;height:80%;top:2px; text-align:center; vertical-align: middle;"> 323</div>
</div>
</td>
-
Jul 24th, 2012, 11:22 PM
#3
Re: <div> in <td> element
Can you please post a visual example(a screenshot) of what you are having now and what you are expecting.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jul 26th, 2012, 12:31 AM
#4
Thread Starter
Hyperactive Member
Re: <div> in <td> element
 Originally Posted by wiss.dev
ok here is what i found, TD position should not be set to absolute. a work around for me was to wrapp the 2 div in another div container
Code:
<td style="position:relative;text-align:center;">
<div style="position:absolute;text-align:center;border:1px solid grey;width:100%;height:100%;top:0px;left:0px;">
<div class="databar" style="position: absolute; height: 90%; width: 60%; border: thin solid aqua;background:yellow; left: 2px;top:0px;"></div>
<div style="position:absolute;left:30%;width:40%;border:1px solid green;height:80%;top:2px; text-align:center; vertical-align: middle;"> 323</div>
</div>
</td>
this was it, i wrapped the 2 divs in another div container
-
Jul 26th, 2012, 12:53 AM
#5
Re: <div> in <td> element
 Originally Posted by wiss.dev
this was it, i wrapped the 2 divs in another div container 
You mean like this : http://jsfiddle.net/Ha3Cw/ ?
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jul 26th, 2012, 05:57 PM
#6
Thread Starter
Hyperactive Member
Re: [RESOLVED] <div> in <td> element
yes, i just did some more css cosmetics and got it exactly like excel bars
-
Jul 26th, 2012, 10:06 PM
#7
Re: [RESOLVED] <div> in <td> element
 Originally Posted by wiss.dev
yes, i just did some more css cosmetics and got it exactly like excel bars
OK. So you were looking for something like this ?

http://i.techrepublic.com.com/blogs/765.jpg
It would have been a lot more better if you had given a visual sample as not everyone would be aware of what an Excel Bar is.
Here's what I have coded to have the above effect: http://jsfiddle.net/kLmPj/

EDIT:
If you do not wish to see it in action by visiting the above link, then here's the code:
HTML Code:
<table id="my_excel">
<thead>
<tr>
<th width="50%">Name</th><th>Marks</th>
</tr>
</thead>
<tbody>
<tr>
<td>ABC1</td>
<td>
<span class="bar" style="width:75%;">75</span>
</td>
</tr>
<tr>
<td>ABC2</td>
<td>
<span class="bar" style="width:50%;">50</span>
</td>
</tr>
<tr>
<td>ABC3</td>
<td>
<span class="bar" style="width:13%;">13</span>
</td>
</tr>
</tbody>
</table>
css Code:
#my_excel{ width: 150px; } #my_excel td{ border: 1px solid black; position: relative; } .bar{ position: absolute; left: 0; top: 0; background-color: lightBlue; }
Last edited by akhileshbc; Jul 26th, 2012 at 10:13 PM.
Reason: added codes
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jul 26th, 2012, 10:13 PM
#8
Thread Starter
Hyperactive Member
Re: [RESOLVED] <div> in <td> element
Thanks Akhileshbc,, i already worked it out
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|