I have develop a website which generates tons of data from Mysql and project to the user but when actually if the user is selected more then a specific data the data is been projected on the header & footer as well but it looks so odd because header & footer it is not stretching as per data.
can any once please help me to resolve.
In summary: I want my CSS to stretch at width & footer for my data as required.
Please help me how can i do this .
Regards,
Nani
Last edited by nani_nisha06; 10-07-2012 at 08:17 AM..
Nani, what is the problem your having? Is it that your html table can open very wide, but the header/footer does not expand with it? Maybe setting the width property to 100% will make it work, but I don't know for sure cause I just have a little of your css and need the html. Try the 100% though.
I dont think a 100% width will solve the issue as it is 100% of the parent's element.
The default behavior is that child takes his width from his parent.
Here we want the opposite: an element that fixe his width according to his content.
Some properties can change the rule: absolute position, float or display:table, for exemple, can force a parent to grow with his children.
This is hard to answer without the HTML, but basicly the idea is to give to the footer/header and table's container a property that will make it grow with the content. So then, the footer and header will take all the room in the parent = the longest content's width.
The content of your website should have a bottom padding equal to the height of your footer, and that will give you enough room for the footer and won't let any content get below the footer.
Let me know if you understood what I tried to explain and good luck with your project!
The content of your website should have a bottom padding equal to the height of your footer, and that will give you enough room for the footer and won't let any content get below the footer.
Let me know if you understood what I tried to explain and good luck with your project!
can I have some sample code.....if you can rectify me on the above code will help me easy understand
I don't do a lot of front-end stuff, but for this, you need a scripting language as the width's will vary depending on the tables' width. HTML alone cannot do this for you.
You need Javascript/JQuery or PHP for this. Personally, i'd use PHP to determine the needed width values as i'm primarily a PHP guy, but for you, you should try JQuery.
For example, for JQuery, try something of this sort:
PHP Code:
<script>
$(document).ready(function(){
var thewidth = $('#MyTable').width();
//Then add width to header and footer
$('#myheader').width(thewidth);
$('#myfooter').width(thewidth);
}
//Then you can apply this width to the header and footer
<script>
Try something along those lines. JQuery really makes work easier . Less code, more logic packed in.
__________________
For professional Hosting and Web design.....
I don't do a lot of front-end stuff, but for this, you need a scripting language as the width's will vary depending on the tables' width. HTML alone cannot do this for you.
You need Javascript/JQuery or PHP for this. Personally, i'd use PHP to determine the needed width values as i'm primarily a PHP guy, but for you, you should try JQuery.
For example, for JQuery, try something of this sort:
PHP Code:
<script> $(document).ready(function(){ var thewidth = $('#MyTable').width();
//Then add width to header and footer $('#myheader').width(thewidth); $('#myfooter').width(thewidth);
}
//Then you can apply this width to the header and footer <script>
Try something along those lines. JQuery really makes work easier . Less code, more logic packed in.
Hi Redcoder,
As you suggested i have try to add & edit above code to my HTMl and I dont see any effect on the Header or footer.
I understand that this can be may be I beacuse I dont have Jquery knowledge...any chance you can help in this case.
Also, After long thinking I have understand one thing is this header and footer are not inherited with the body that is the reason when body is getting stretch with the data header & footer stretch is not happening.....
I am worried with issue coz almost 70% of my website is done....and my deadline is near by to complete this task ???
And
Another issues i am trying to fight with is a inline editing in the form with DB update parallel but, I don't find any help so, any help from your end is much more appreciated .
Let me know if you want sample of my CSS and template....?
Thanks A head.
Regards,
Nani
Last edited by nani_nisha06; 10-27-2012 at 06:30 PM..