Hello everyone !
I have a little question about the jquery tabs and the height of the container.
No code is necessary, because the problem may occurs in an other context, I think.
In the <div> of data content of the jquery tabs, if content like <p>Some_content</p> so the height automatically resize to the good size.
But if content like <table>Table_content_which_come_from_ckeditor</table>, the height of the <table> is not considered and so the height of the <div> data content isn't correct.
I try to place a <div> or a <p> before and after the <table> but no, I don't know how to keep the height of the <table> to have the correct one...
Do you have an idea ? Maybe a css style to add ?
Thanks for your suggests.
Best regards,
Steve.
[Resolved] tabs : height's container not correct with table
Moderator: General Moderators
-
styvodiabolo
- Forum Newbie
- Posts: 13
- Joined: Tue May 19, 2009 2:18 pm
[Resolved] tabs : height's container not correct with table
Last edited by styvodiabolo on Sat Apr 03, 2010 2:27 pm, edited 1 time in total.
-
styvodiabolo
- Forum Newbie
- Posts: 13
- Joined: Tue May 19, 2009 2:18 pm
Re: tabs : height's container not correct with table
Hey, the solution is here, strange but works : I do a preg_match() on the content and if I find a <table> so I add a <p> with a height style of table height.
In case of you know however the real problem of the no-consider height of the table, I will have a ear to listen
Good continue in programming !
Steve.
In case of you know however the real problem of the no-consider height of the table, I will have a ear to listen
Good continue in programming !
Steve.
-
styvodiabolo
- Forum Newbie
- Posts: 13
- Joined: Tue May 19, 2009 2:18 pm
Re: [Resolved] tabs : height's container not correct with ta
Hi,
The previous solution doesn't work correctly because the height's table is always the same.
Here is the new code which finally works
So, I add a div over the table with a unique id, then the famous <p> which grown the height's content and so the little part of jquery code get the real height of the table.
Bye.
Steve.
The previous solution doesn't work correctly because the height's table is always the same.
Here is the new code which finally works
Code: Select all
$matches = array();
if(preg_match('/<table.*height:\s(.+)px.*>/U',$content,$matches))
$content = '<div id="content_height_'.$ct_id.'">'.$content.'</div>'
.'<p id="add_content_height_'.$ct_id.'"></p>'
.'<script type="text/javascript">
$("p#add_content_height_'.$ct_id.'").css("height",
$("div#content_height_'.$ct_id.' table").height());
</script>';
$contents[$ct_id] = $content;
Bye.
Steve.