473,395 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Stretch elements in table column IE 7

Hey,

im trying to stretch all html elements inside a table column. All of these should be the same width as the broadest.


Example:
http://i.imgur.com/WgeuI.png

Im not setting the width of the elements, its automatically set. Now i want, that all elements have the same width as the broadest ( in this example the last ). How can i realize that?

I played something around with
"display:inline-block"
and the ie7 version:
"zoom: 1;"
"*display: inline;"

but nothing worked...
The problem is, I dont know which is the broadest.
And I have to use IE7 without JS for this.

Hope you guys can help me :)

Thanks!
Nov 20 '12 #1
7 2757
Rabbit
12,516 Expert Mod 8TB
It would help to see the code.
Nov 20 '12 #2
Ahh sorry :)
Its a jsp so I hope you can read it :).

JSP ( removed some unnecessary parts )
Expand|Select|Wrap|Line Numbers
  1. <table>
  2.                         <tbody>
  3.                             <c:forEach var="elem" items="${tableStructure}">
  4.                                 <tr>
  5.                                     <td class="left">
  6.                                          <c:out value="${elem.label}" />
  7.                                     </td>
  8.  
  9.                                     <td>
  10.                                         <c:choose>
  11.                                             <c:when test="${ empty(elem.cbItems) }">
  12.                                                 <span class="inline">
  13.                                                     <input type="text" name="editta;${datarow.primaryKey};${elem.fieldName}" />
  14.                                                  </span>
  15.                                             </c:when>
  16.                                             <c:otherwise>
  17.                                                 <span class="inline">
  18.                                                     <select name="testname">
  19.                                                         <option value=""></option>
  20.                                                         <c:forEach var="cbItem" items="${elem.cbItems}">
  21.                                                             <option value="${cbItem.value}">${cbItem.shownName}</option>
  22.                                                         </c:forEach>
  23.                                                     </select>
  24.                                                     </span>
  25.                                             </c:otherwise>
  26.                                         </c:choose>
  27.                                     </td>
  28.                                 </tr>
  29.                             </c:forEach>
  30.                         </tbody>
  31.                     </table>
CSS:
Expand|Select|Wrap|Line Numbers
  1. body {
  2.     background-color: #DEDCDD;
  3.     font-family:Verdana,Arial,sans-serif;
  4.     font-size:1em;
  5.     font-weight:bold;
  6. }
  7.  
  8. table
  9. {
  10.     /*overflow: auto;
  11.     white-space: wrap;
  12.     word-wrap: break-word;
  13.     border-spacing:0;*/
  14.       border-collapse:collapse;
  15.  
  16.       border-style:solid;
  17.       border-color:rgb(136,136,136);
  18.       boorder-width: 2px;
  19. }
  20.  
  21. td {
  22.     color: black;
  23. }
  24.  
  25. td.left {
  26.     text-align:right;
  27.     padding-left:20px;
  28. }
  29.  
  30.  
  31. tbody td {
  32.     height:40px;
  33.  
  34.     background-color: white;
  35.     border-bottom-style: solid;
  36.     border-bottom-color: rgb(136,136,136);
  37.     border-bottom-width: 1px;
  38. }
  39.  
  40. tbody tr:hover td
  41. {
  42.     background-color: rgb(176, 176, 184);
  43.     color:rgb(232,232,232);
  44. }
  45.  
  46. .inline
  47. {
  48.     display: inline-block;
  49.     zoom: 1;
  50.     *display: inline;
  51. }

Thanks :)
Nov 21 '12 #3
Rabbit
12,516 Expert Mod 8TB
Have you tried applying a width: 100% to the elements?
Nov 21 '12 #4
Yes, but the column has no width then :/

Edit: Ok tried it again, all the elements are small. I think they have the size of the first element.
Nov 22 '12 #5
Rabbit
12,516 Expert Mod 8TB
It's hard to see what you're aiming for in the code because there's only one row in the table.
Nov 22 '12 #6
There is more than 1 row in the table as you can see in my picture in my first post. Its a jsp with a foreach in my code so there are so much rows as elements in the list :)

Expand|Select|Wrap|Line Numbers
  1. <c:forEach var="elem" items="${tableStructure}">
  2.                                 <tr>
  3.  
Nov 23 '12 #7
Rabbit
12,516 Expert Mod 8TB
It'd be easier to diagnose if we had the code as the client sees it rather than how the server sees it.
Nov 24 '12 #8

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

Similar topics

3
by: Martin Lucas-Smith | last post by:
Can anyone point me to a regular expression in PHP which could be used to check that a proposed (My)SQL database/table/column name is valid, i.e. shouldn't result in an SQL error when created? ...
1
by: chelleybabyger | last post by:
Using the below method, <% remaining_stock = cint(product_stock) - cint(chQuantity) %> <% sqlString = "UPDATE Products SET " &_ "product_stock='" & remaining_stock & "'," &_ "WHERE...
3
by: Albretch | last post by:
I am trying to insert some textual data belonging to an HTML page into a table column with 'TEXT' as data type mysql's maual _/manual.html#String_types tell you, you may insert up to (2^16 - 1),...
1
by: VMI | last post by:
How can I sort a table column correctly when the table has values like "0", "A1", "AA-1", "B21", "3C", 4-32A", "1", "11-1", 2-A", etc... The table will then be loaded to a grid and that's when...
4
by: Justin | last post by:
Using an SqlDataReader what is the best way to determine if a table column has specified value? Thanks, Justin.
4
by: Scot L. Harris | last post by:
Currently using Postgresql 7.2.4-5.80 with php 4.2.2.-8.0.8 on a redhat 8.0 system. I am writing some php scripts where I want to generate a list of the column names in a particular table that...
1
by: luthriaajay | last post by:
I am creating elements and attributes in my XSL. I need to first map the element created with the table name? Is this possible in XSL? I am using Java. For example :
8
by: mguy27 | last post by:
We have about 2 dozen security officers who patrol about 120 buildings. They find defective or unlocked doors and write a "Trouble Report" on the door. This card gets turned in, where I have designed...
8
by: gigonomics | last post by:
Hi all, I hope someone can help me out. I need to return the best available seats subject to the constraint that the seats are side by side (or return X consecutive records from a table column...
3
by: jagdeep gupta | last post by:
Here i use image in background in table column it does not displays the image but if i apply the same path for img tag in foreground it displays. Here is code: <%@ Master Language="C#"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.