Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Detect the width

Posted on 2003-10-24
6
Medium Priority
?
161 Views
Last Modified: 2010-04-09
Dear All,
I got table displayed 100% of the client screen.
inside that table i have small tables (around 100 table ) , I want to automatically dedect the width of the big table to decide how many small tables i should display it per row.
Thanks.
0
Comment
Question by:ethar1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 31

Accepted Solution

by:
seanpowell earned 1000 total points
ID: 9616267
Well, one way would be to put the tables into div's with the float:left attribute. That way the tables will drop to the next level when they run out of room...


<table border="1" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td width="100%">
    <div style="float:left; width:100;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>
    <div style="float:left; width:100;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>
    <div style="float:left; width:100;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>
    <div style="float:left; width:100;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>
    <div style="float:left; width:100;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>
    <div style="float:left; width:100;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>
    <div style="float:left; width:100;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>
    <div style="float:left; width:100;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>            
    </td>
  </tr>
</table>
0
 

Author Comment

by:ethar1
ID: 9616375
Thanks  georgemarian for you great and prompt help :)
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9616417
You're welcome, and thanks for the A :-)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:ethar1
ID: 9617063
georgemarian, can  you please tell me how lead a space between div and another?
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9617094
If you mean how to "leave" a space between two div's, like this:

    <div style="float:left; width:100px; margin-right:10px;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>
    <div style="float:left; width:100px; margin-right:10px;">
    <table border="1" cellpadding="0" cellspacing="0" width="100">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
    </div>

So, each div will have a 10 pixel margin on the right. Depending on how you want it spaced, you have a number of options:

Margin's all around:
<div style="float:left; width:100px; margin:10px;">

Only on both sides:
<div style="float:left; width:100px; margin-left:10px; margin-right:10px;">

Just on the top:
<div style="float:left; width:100px; margin-top:10px;">

etc...

Let me know if that helps you.
0
 

Author Comment

by:ethar1
ID: 9618877
YES, It helps me so so much.
Thanks man
0

Featured Post

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

636 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