Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

table / 3 td / first-child same width / second width depends on 3rd content/

Featured Replies

Sup guys, i've stuck and dont know what to do, maybe someone will help me with this one.

<table width="860">
<tr>
<td>8.10 - 9.00</td>
<td>text text text text text text text text</td>
<td>
    <img src="img/_temp/50x50.jpg"/>
    <img src="img/_temp/50x50.jpg"/>
    <img src="img/_temp/50x50.jpg"/>
    <img src="img/_temp/50x50.jpg"/>
</td>
</tr>
</table>

Alright,

in first td we have a hours when meeting starts and this td have width of 160px.

Second td have some text and width of it depends on width of third td.

Third td have thumbnails in it, thumbs must be inline and auto width. (each thumbnail 50x50).

Sometimes will be one, sometimes will be 5 or 10 or 3....

 

Can someone tell me how to get this working with all td's in row not clearing ech other ?

Any help will be good - im dont have any ideas left how to get this working.

Edited by n0xx

  • Author

Ok, maybe someone will help me other way.

 

<wrapper> <1st element> <2nd element> <3rd element> </wrapper>

 

 

wrapper = 860px

1st element = 135px

 

I would like to have jquery script that calculate for me width of 3rd element and after calculate what width is it set width of 2nd element:

check what 3rd element have width

wrapper - 1st width - 3rd width = 2nd element width

set 2nd element width.

 

Is it even possible if there would be 20 wrappers like this and every with different 3rd element width ?

Maybe this video tutorial will be helpful. I'm showing how to get the height of an element and assign it to other elements. You can easily adapt the script to capture and set widths instead of heights just target the offsetWidth property instead os offsetHeight.

Link to the video:

http://www.youtube.com/watch?v=_uqhQf7X5o4
Link to the code from the tutorial: http://www.nielsharbo.dk/tutorials-eng.php

Edited by Nillervision

Have a look at this example http://www.wickham43.com/forumposts/n0xx131031.html . The top table has a width of 250px for the right column but the middle table the right column has no width (ie auto width, normally to match the widest requirement). In this case the middle table right column has only eleven icons as the table sofware seems to have decided that eleven is all it wants to show, even though it could have reduced the middle column a little more! So much for the browser's programming. IE and Firefox both do this, because the auto widths are apportioned if no width is stated according to the rules for tables. Same in the bottom right column.

 

In the top table the right column icons just stack if there are too many for the fixed 250px width and the left and middle columns apportion the remaining width.

 

In the middle table the left column auto width gets squashed unless you give it a fixed width of 160px because the right column has too many icons.

 

In the lowest example the left column has a fixed width of 160px.

 

If you use the javascript method, remember that not everyone has javascript enabled.

Edited by Wickham

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.