HTML Help
Mar 21 2008, 6:13 pm
By: Forsaken Archer  

Mar 21 2008, 6:13 pm Forsaken Archer Post #1



Yes, help with HTML.
I want to do blocks of text/images that wrap. I can't figure out how. Anyone know how this can be done?

Hmm, picture a row of table cells, each with a different number in it. At the end of the page, the cells would wrap and keep going.

[1] [2] [3] [4] [5] [6] | page end
[7] [8] [9] [10

However, since each page can be a different width (from the user), there is no way I could know how many of these elements will fit in one row.
Each element will have a link break in it as well, which seems to defeat horizontal lists.



Example that doesn't work (as it shrinks the divs and doesn't wrap):
Code
<div style="background-color:darkred">
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
<div style="display:table-cell;border:1px solid black;width:200px;padding:4px;">1<br />2</div>
</div>


Post has been edited 1 time(s), last time on Mar 21 2008, 11:32 pm by isolatedpurity.



None.

Mar 21 2008, 6:41 pm who Post #2



i'm not really sure about this, since I suck at coding, but is it possible to retrieve the width of the page (if it's a div or something), then check if it can fit all of the boxes?
I'm probably wrong though. :lol:



None.

Mar 21 2008, 6:45 pm Forsaken Archer Post #3



You could with javascript, yes. But if I have to resort to that, I'd rather just assume lowest possible width and break them up manually.



None.

Mar 21 2008, 8:24 pm Centreri Post #4

Relatively ancient and inactive

Can't you do this with PHP? I'm not sure what this is for, but I think, whatever you're talking about there, if you measure the width of everything, add it up with additional spaces and all that, subtract the sides, and compare to the width resolution of the person watching it, you can display only a specific # of whatever it is you're displaying.

I don't think HTML has something to do that, or CSS. Javascript might have an alternative.



None.

Mar 21 2008, 10:42 pm who Post #5



I don't think you can retrieve a CSS value with PHP, only with Javascript.
e.g. box1=document.getElementById('box');
box1width=box1.width

i think that's how it works, as far as I remember.



None.

Mar 22 2008, 2:51 am Centreri Post #6

Relatively ancient and inactive

Depends on what's inside the value. If it's an image or something, PHP can do it. Need MOAR informations!



None.

Mar 22 2008, 3:13 am who Post #7



well obviously some boxes will have text



None.

Mar 22 2008, 3:15 am Centreri Post #8

Relatively ancient and inactive

Oh. He said text/images.

Well.. You CAN make a highly accurate estimation based on text analysis and image specification. However, I really think Javascript seems to be the easier way here.



None.

Mar 22 2008, 4:44 am Forsaken Archer Post #9



PHP has absolutely nothing to do with page display.



None.

Mar 22 2008, 2:13 pm Centreri Post #10

Relatively ancient and inactive

If the elements displayed are displayed via PHP, you can use it to accurately estimate the width by analyzing what its composed of. As I said, however, this is much longer then using some Javascript.



None.

Mar 22 2008, 3:49 pm Forsaken Archer Post #11



I see what you are saying (though it still isn't true ^^). The width of each element will always be the same anyways.



None.

Mar 22 2008, 5:31 pm Centreri Post #12

Relatively ancient and inactive

Why isn't it true..
Wait, I thought the elements you need to wrap were different. Just the resolution is different? That makes things much easier. Use Javascript to detect resolution, subtract the sides and spaces between the elements.. and... Is it possible to use Javascript to move it over? If not, the only thing I can think of is making Javascript interact with PHP and have PHP move it over.



None.

Mar 22 2008, 7:31 pm who Post #13



javascript can do document.write("<br>"); or something similar, if you're using breaks to wrap the boxes



None.

Mar 22 2008, 7:36 pm Forsaken Archer Post #14



http://www.staredit.net/39733/ :(



None.

Mar 23 2008, 7:42 am Rantent Post #15



Quote from IP
Yes, help with HTML.
A table? lol... I must not understand the question.

Oh, I see what your wanting.....
Javascript would make it easy.
*picks up old programming notes and looks through them*
I can't find a way to fully wrap text.
Why can't you simply settle for align="right" ect.?

Post has been edited 2 time(s), last time on Mar 23 2008, 8:05 am by Rantent.



None.

Mar 23 2008, 4:28 pm Centreri Post #16

Relatively ancient and inactive

It'll all be on one line and it'll stretch the page horizontally.



None.

Mar 23 2008, 8:30 pm Cole Post #17



You'd need javascript.
PHP wont work. Why? Well you could calculate everything based on there resolution size with PHP. However, what if they take the browser window and resize it? You need something to do it in realtime like javascript.
find the width of the window or resolution;
subtract margins;
divide that by how wide each cell will be;
round downward;
write out tables/div's;



None.

Mar 23 2008, 8:42 pm Forsaken Archer Post #18



I know it's possible in javascript. And it'll be somewhat easy. I was wondering if there was a html/css only way to do it.



None.

Mar 23 2008, 10:45 pm O)FaRTy1billion[MM] Post #19

👻 👾 👽 💪

Like this?
http://farty1billion.dyndns.org/lolwut.htm



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Mar 23 2008, 10:55 pm who Post #20



nice, didn't think it was that simple



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:31 pm]
Vrael -- :wob:
[08:42 pm]
Ultraviolet -- :wob:
[2024-5-08. : 10:09 pm]
Ultraviolet -- let's fucking go on a madmen rage bruh
[2024-5-08. : 10:01 pm]
Vrael -- Alright fucks its time for cake and violence
[2024-5-07. : 7:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
Please log in to shout.


Members Online: Roy